public static void deserializeSessionAttributes ( final HttpSession session ) { File file = new File ( SERIALIZE_SESSION_NAME ) ; FileInputStream fis = null ; ObjectInputStream ois = null ; if ( file . canRead ( ) ) { try { fis = new FileInputStream ( file ) ; ois = new ObjectInputStream ( fis ) ; List data = ( List ) ois . readObject ( ) ; for ( Iterator i = data . iterator ( ) ; i . hasNext ( ) ; ) { String key = ( String ) i . next ( ) ; Object value = i . next ( ) ; session . setAttribute ( key , value ) ; } } catch ( Exception e ) { LOG . error ( "Failed to read serialized session from " + file , e ) ; } finally { if ( ois != null ) { StreamUtil . safeClose ( ois ) ; } else { StreamUtil . safeClose ( fis ) ; } } } else { LOG . warn ( "Unable to read serialized session from " + file ) ; } }
Attempts to deserialize the persisted session attributes into the given session .