Class ConcurrentFileExtractor
java.lang.Object
electrostatic4j.snaploader.filesystem.FileExtractor
electrostatic4j.snaploader.filesystem.ConcurrentFileExtractor
- All Implemented Interfaces:
OutputStreamProvider,StreamProvider,AutoCloseable
- Direct Known Subclasses:
LibraryExtractor
A thread-safe implementation of the filesystem extractor API.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ReentrantLockAn Object that controls the monitor.Fields inherited from class electrostatic4j.snaploader.filesystem.FileExtractor
destination, fileExtractionListener, fileLocator, fileOutputStream -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiates an empty filesystem extractor instance.ConcurrentFileExtractor(FileLocator fileLocator, String destination) Instantiates a thread-safe filesystem extractor instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidextract()Commands and Extract the specified filesystem to the specified destination filesystem.Methods inherited from class electrostatic4j.snaploader.filesystem.FileExtractor
close, getFileLocator, getFileOutputStream, initialize, setExtractionListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface electrostatic4j.snaploader.filesystem.StreamProvider
getHashKey
-
Field Details
-
lock
An Object that controls the monitor.
-
-
Constructor Details
-
ConcurrentFileExtractor
Instantiates a thread-safe filesystem extractor instance.- Parameters:
fileLocator- locates a filesystem inside a zip compressiondestination- an absolute filesystem path representing the extraction destination filesystem
-
ConcurrentFileExtractor
protected ConcurrentFileExtractor()Instantiates an empty filesystem extractor instance.
-
-
Method Details
-
extract
Description copied from class:FileExtractorCommands and Extract the specified filesystem to the specified destination filesystem.Warning: this function leaks buffered streams; this vision was attained for freedom of use, but the user application must keep in mind that stream closure and resources release must be attained either through the extraction completed and failure listeners, or through a try-with resources.
- Overrides:
extractin classFileExtractor- Throws:
IOException- if the input/output streams has failed or an interrupted I/O operation has occurred.FileNotFoundException- if the file locator has failed to locate the file inside the compression for the extraction process.
-