|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream java.io.ObjectInputStream org.archive.io.ObjectPlusFilesInputStream
public class ObjectPlusFilesInputStream
Enhanced ObjectOutputStream with support for restoring files that had been saved, in parallel with object serialization.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.io.ObjectInputStream |
---|
java.io.ObjectInputStream.GetField |
Field Summary | |
---|---|
(package private) java.util.LinkedList<java.io.File> |
auxiliaryDirectoryStack
|
(package private) java.util.LinkedList<java.lang.Runnable> |
postRestoreTasks
|
Fields inherited from interface java.io.ObjectStreamConstants |
---|
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING |
Constructor Summary | |
---|---|
ObjectPlusFilesInputStream(java.io.InputStream in,
java.io.File storeDir)
Instantiate over the given stream and using the supplied auxiliary storage directory. |
Method Summary | |
---|---|
void |
close()
In addition to default, do any registered cleanup tasks. |
java.io.File |
getAuxiliaryDirectory()
Return the top auxiliary directory, from which saved files are restored. |
void |
popAuxiliaryDirectory()
Discard the top auxiliary directory. |
void |
pushAuxiliaryDirectory(java.lang.String dir)
Push another default storage directory for use until popped. |
void |
registerFinishTask(java.lang.Runnable task)
Register a task to be done when the ObjectPlusFilesInputStream is closed. |
void |
restoreFile(java.io.File destination)
Restore a file from storage, using the name and length info on the serialization stream and the file from the current auxiliary directory, to the given File. |
void |
restoreFileTo(java.io.File directory)
Restore a file from storage, using the name and length info on the serialization stream and the file from the current auxiliary directory, to the given File. |
Methods inherited from class java.io.ObjectInputStream |
---|
available, defaultReadObject, enableResolveObject, read, read, readBoolean, readByte, readChar, readClassDescriptor, readDouble, readFields, readFloat, readFully, readFully, readInt, readLine, readLong, readObject, readObjectOverride, readShort, readStreamHeader, readUnshared, readUnsignedByte, readUnsignedShort, readUTF, registerValidation, resolveClass, resolveObject, resolveProxyClass, skipBytes |
Methods inherited from class java.io.InputStream |
---|
mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.io.ObjectInput |
---|
read, skip |
Field Detail |
---|
java.util.LinkedList<java.io.File> auxiliaryDirectoryStack
java.util.LinkedList<java.lang.Runnable> postRestoreTasks
Constructor Detail |
---|
public ObjectPlusFilesInputStream(java.io.InputStream in, java.io.File storeDir) throws java.io.IOException
in
- storeDir
-
java.io.IOException
Method Detail |
---|
public void pushAuxiliaryDirectory(java.lang.String dir)
dir
- public void popAuxiliaryDirectory()
public java.io.File getAuxiliaryDirectory()
public void restoreFile(java.io.File destination) throws java.io.IOException
destination
-
java.io.IOException
public void restoreFileTo(java.io.File directory) throws java.io.IOException
directory
-
java.io.IOException
public void registerFinishTask(java.lang.Runnable task)
task
- public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.io.ObjectInput
close
in class java.io.ObjectInputStream
java.io.IOException
InputStream.close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |