Package net.sf.basedb.plugins
Class ZipFileUnpacker
java.lang.Object
net.sf.basedb.core.plugin.AbstractPlugin
net.sf.basedb.util.zip.AbstractFileUnpacker
net.sf.basedb.plugins.ZipFileUnpacker
- All Implemented Interfaces:
InteractivePlugin
,Plugin
,SignalTarget
,FileUnpacker
A plugin for unpacking zip and jar file on the BASE file system.
- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin
Plugin.MainType
-
Field Summary
Modifier and TypeFieldDescriptionFields inherited from class net.sf.basedb.util.zip.AbstractFileUnpacker
OVERWRITE, UNPACK_DIRECTORY, ZIP_FILE
Fields inherited from class net.sf.basedb.core.plugin.AbstractPlugin
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn a set containing the strings [ zip, jar ].Get the name of the compressed file format this unpacker supports.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 theZipUnpacker
to unpack the file.Methods inherited from class net.sf.basedb.util.zip.AbstractFileUnpacker
configure, getCurrentDirectory, getCurrentFile, getDirectoryParameter, getGuiContexts, getMainType, getOverwrite, getOverwriteParameter, getPermissions, getRequestInformation, getSignalHandler, getUnpackDirectory, getZipFile, getZipFileParameter, isInContext, requiresConfiguration, run, supportsConfigurations
Methods inherited from class net.sf.basedb.core.plugin.AbstractPlugin
cloneParameterWithDefaultValue, closeLogFile, createLogFile, done, getCopyAnnotationsParmeter, getCurrentConfiguration, getCurrentJob, getJobOrConfigurationValue, getOverwriteAnnotationsParameters, init, isLogging, log, log, storeValue, storeValue, storeValues, validateRequestParameters
-
Field Details
-
extensions
-
mimeTypes
-
-
Constructor Details
-
ZipFileUnpacker
public ZipFileUnpacker()
-
-
Method Details
-
getFormatName
Description copied from interface:FileUnpacker
Get the name of the compressed file format this unpacker supports. For example: ZIP files -
getExtensions
Return a set containing the strings [ zip, jar ].- Returns:
- A set containing file extensions (do not inlcude the dot)
-
getMimeTypes
Return a set containing the strings [ application/zip, application/java-archive ].- Returns:
- A set containing MIME types
-
unpack
public int unpack(DbControl dc, Directory dir, InputStream in, File sourceFile, boolean overwrite, AbsoluteProgressReporter progress) throws IOException Use theZipUnpacker
to unpack the file.- Parameters:
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 uncompressed- Returns:
- The number of unpacked files
- Throws:
IOException
- If there is an error reading the input stream
-