public interface FileUnpacker extends Plugin
AbstractFileUnpacker
class 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.
ZipFileUnpacker
,
AbstractFileUnpacker
Plugin.MainType
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getExtensions()
Get the file extensions that this unpacker supports.
|
java.lang.String |
getFormatName()
Get the name of the compressed file format this unpacker supports.
|
java.util.Set<java.lang.String> |
getMimeTypes()
Get the MIME type for the file formats this unpacker supports.
|
int |
unpack(DbControl dc,
Directory dir,
java.io.InputStream in,
File sourceFile,
boolean overwrite,
AbsoluteProgressReporter progress)
Unpack the given input stream into a BASE directory.
|
done, getMainType, getPermissions, init, requiresConfiguration, run, supportsConfigurations
java.lang.String getFormatName()
java.util.Set<java.lang.String> getExtensions()
java.util.Set<java.lang.String> getMimeTypes()
int unpack(DbControl dc, Directory dir, java.io.InputStream in, File sourceFile, boolean overwrite, AbsoluteProgressReporter progress) throws java.io.IOException, BaseException
PackUtil.copyProperties(File, File)
.dc
- The DbControl to use for database accessdir
- The directory to unpack the files toin
- The input stream containing the packed datasourceFile
- The source packed file that the input stream is
coming from or null if not knownoverwrite
- If existing files should be overwritten or ignoredprogress
- A optional progress reporter which expects the number
of compressed bytes that has been uncompressedjava.io.IOException
- If there is an error reading the input streamBaseException
- If there is another error