- All Superinterfaces:
- All Known Implementing Classes:
public interface FileUnpacker extends Plugin
This interface should be implemented by plugins that can unpack a single compressed file into the BASE file system. The plugin may extend the
AbstractFileUnpackerclass which implements most of the plugin specified parts, leaving only the actual unpacking to the subclass.
The file upload functionality checks all plugins that implement this interface to provide automatic unpacking of uploaded files without having to store them in a temporary place first.
Nested Class Summary
Modifier and Type Method Description
()Get the file extensions that this unpacker supports.
()Get the name of the compressed file format this unpacker supports.
()Get the MIME type for the file formats this unpacker supports.
DbControl dc, Directory dir, InputStream in, File sourceFile, boolean overwrite, AbsoluteProgressReporter progress)(Unpack the given input stream into a BASE directory.
getFormatNameString getFormatName()Get the name of the compressed file format this unpacker supports. For example: ZIP files
getExtensionsGet the file extensions that this unpacker supports. For example [ zip, jar ].
- A set containing file extensions (do not inlcude the dot)
getMimeTypesGet the MIME type for the file formats this unpacker supports. For example [ application/zip, application/java-archive ].
- A set containing MIME types
unpackint unpack(DbControl dc, Directory dir, InputStream in, File sourceFile, boolean overwrite, AbsoluteProgressReporter progress) throws IOException, BaseExceptionUnpack the given input stream into a BASE directory. If a source file is given it can be used as a template for setting certain properties on the unpcked files. See
dc- The DbControl to use for database access
dir- The directory to unpack the files to
in- The input stream containing the packed data
sourceFile- The source packed file that the input stream is coming from or null if not known
overwrite- If existing files should be overwritten or ignored
progress- A optional progress reporter which expects the number of compressed bytes that has been uncompressed
- The number of unpacked files
IOException- If there is an error reading the input stream
BaseException- If there is another error