KEYCLOAK-5666 removed not needed decodeToObject methods
This commit is contained in:
1 parent
27b5e1aae2
commit
e29ccebc21
2 files changed
+44
-174
No files matched your search
@@ -693,48 +693,6 @@ public class Base64 {
|
||||
return bytes;
|
||||
} // end decode
|
||||
|
||||
/**
|
||||
* Attempts to decode Base64 data and deserialize a Java Object within. Returns <tt>null</tt> if there was an error.
|
||||
*
|
||||
* @param encodedObject The Base64 data to decode
|
||||
* @return The decoded and deserialized object
|
||||
* @since 1.5
|
||||
*/
|
||||
public static Object decodeToObject(String encodedObject) {
|
||||
// Decode and gunzip if necessary
|
||||
byte[] objBytes = decode(encodedObject);
|
||||
|
||||
java.io.ByteArrayInputStream bais = null;
|
||||
java.io.ObjectInputStream ois = null;
|
||||
Object obj = null;
|
||||
|
||||
try {
|
||||
bais = new java.io.ByteArrayInputStream(objBytes);
|
||||
ois = new java.io.ObjectInputStream(bais);
|
||||
|
||||
obj = ois.readObject();
|
||||
} // end try
|
||||
catch (java.io.IOException e) {
|
||||
e.printStackTrace();
|
||||
obj = null;
|
||||
} // end catch
|
||||
catch (java.lang.ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
obj = null;
|
||||
} // end catch
|
||||
finally {
|
||||
try {
|
||||
bais.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
try {
|
||||
ois.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
} // end finally
|
||||
|
||||
return obj;
|
||||
} // end decodeObject
|
||||
|
||||
/* ******** I N N E R C L A S S I N P U T S T R E A M ******** */
|
||||
|
||||
|
||||
Reference in new issue
Block a user