public class TarFileUnpacker extends AbstractFileUnpacker
Plugin.MainType
Modifier and Type | Field and Description |
---|---|
private static java.util.Set<java.lang.String> |
extensions |
private static java.util.Set<java.lang.String> |
mimeTypes |
private java.util.Map<java.lang.String,Directory> |
paths |
OVERWRITE, UNPACK_DIRECTORY, ZIP_FILE
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc
Constructor and Description |
---|
TarFileUnpacker() |
Modifier and Type | Method and Description |
---|---|
private Directory |
getDirectory(DbControl dc,
Path path)
Get the directory for the specified path.
|
java.util.Set<java.lang.String> |
getExtensions()
Return a set containing the strings [ tar, tar.gz, tgz, tar.bz2 ].
|
java.lang.String |
getFormatName()
Get the name of the compressed file format this unpacker supports.
|
java.util.Set<java.lang.String> |
getMimeTypes()
Return a set containing the strings [ application/x-tar, application/x-gzip,
application/x-bzip2 ].
|
int |
unpack(DbControl dc,
Directory rootDir,
java.io.InputStream in,
File sourceFile,
boolean overwrite,
AbsoluteProgressReporter progress)
Unpack the given input stream into a BASE directory.
|
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
private static final java.util.Set<java.lang.String> extensions
private static final java.util.Set<java.lang.String> mimeTypes
private java.util.Map<java.lang.String,Directory> paths
public java.lang.String getFormatName()
FileUnpacker
public java.util.Set<java.lang.String> getExtensions()
public java.util.Set<java.lang.String> getMimeTypes()
public int unpack(DbControl dc, Directory rootDir, java.io.InputStream in, File sourceFile, boolean overwrite, AbsoluteProgressReporter progress) throws java.io.IOException
FileUnpacker
PackUtil.copyProperties(File, File)
.dc
- The DbControl to use for database accessrootDir
- 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 streamprivate Directory getDirectory(DbControl dc, Path path)
path
- The path