public class ZipFileUnpacker extends AbstractFileUnpacker
Plugin.MainType
Modifier and Type | Field and Description |
---|---|
private static Set<String> |
extensions |
private static Set<String> |
mimeTypes |
OVERWRITE, UNPACK_DIRECTORY, ZIP_FILE
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc
Constructor and Description |
---|
ZipFileUnpacker() |
Modifier and Type | Method and Description |
---|---|
Set<String> |
getExtensions()
Return a set containing the strings [ zip, jar ].
|
String |
getFormatName()
Get the name of the compressed file format this unpacker supports.
|
Set<String> |
getMimeTypes()
Return a set containing the strings [ application/zip, application/java-archive ].
|
int |
unpack(DbControl dc,
Directory dir,
InputStream in,
File sourceFile,
boolean overwrite,
AbsoluteProgressReporter progress)
Use the
ZipUnpacker to unpack the file. |
configure, getCurrentDirectory, getCurrentFile, getDirectoryParameter, getGuiContexts, getMainType, getOverwrite, getOverwriteParameter, getPermissions, getRequestInformation, getSignalHandler, getUnpackDirectory, getZipFile, getZipFileParameter, isInContext, requiresConfiguration, run, supportsConfigurations
cloneParameterWithDefaultValue, closeLogFile, createLogFile, done, getCopyAnnotationsParmeter, getCurrentConfiguration, getCurrentJob, getJobOrConfigurationValue, getOverwriteAnnotationsParameters, init, log, log, storeValue, storeValue, storeValues, validateRequestParameters
public String getFormatName()
FileUnpacker
public Set<String> getExtensions()
public Set<String> getMimeTypes()
public int unpack(DbControl dc, Directory dir, InputStream in, File sourceFile, boolean overwrite, AbsoluteProgressReporter progress) throws IOException
ZipUnpacker
to unpack the 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 uncompressedIOException
- If there is an error reading the input stream