public class TarArchiver extends AbstractArchiver
Modifier and Type | Class and Description |
---|---|
static class |
TarArchiver.TarCompressionMethod
Valid Modes for Compression attribute to Tar Task
|
class |
TarArchiver.TarOptions
Valid Modes for Compression attribute to Tar Task
|
Modifier and Type | Field and Description |
---|---|
private TarArchiver.TarCompressionMethod |
compression |
private TarLongFileMode |
longFileMode |
private boolean |
longWarningGiven
Indicates whether the user has been warned about long files already.
|
private TarArchiver.TarOptions |
options |
private org.apache.commons.compress.archivers.tar.TarArchiveOutputStream |
tOut |
DEFAULT_DIR_MODE, DEFAULT_FILE_MODE, DEFAULT_SYMLILNK_MODE, DUPLICATES_ADD, DUPLICATES_FAIL, DUPLICATES_PRESERVE, DUPLICATES_SKIP, DUPLICATES_VALID_BEHAVIORS, ROLE
Constructor and Description |
---|
TarArchiver() |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanUp() |
protected void |
close() |
private java.io.OutputStream |
compress(TarArchiver.TarCompressionMethod tarCompressionMethod,
java.io.OutputStream ostream) |
protected void |
execute() |
protected java.lang.String |
getArchiveType() |
boolean |
isSupportingForced()
Returns, whether the archive supports uptodate checks.
|
void |
setCompression(TarArchiver.TarCompressionMethod mode)
Set compression method.
|
void |
setLongfile(TarLongFileMode mode)
Set how to handle long files, those with a path>100 chars.
|
protected void |
tarFile(ArchiveEntry entry,
org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tOut,
java.lang.String vPath)
tar a file
|
addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchiveFinalizer, addDirectory, addDirectory, addDirectory, addDirectory, addFile, addFile, addFileSet, addResource, addResources, addSymlink, addSymlink, asArchiveEntry, asResourceCollection, checkForced, contextualize, createArchive, getDefaultDirectoryMode, getDefaultFileMode, getDestFile, getDirectoryMode, getDuplicateBehavior, getFileMode, getFiles, getIncludeEmptyDirs, getLogger, getOverrideDirectoryMode, getOverrideFileMode, getRawDefaultFileMode, getResources, hasVirtualFiles, isForced, isIgnorePermissions, isUptodate, isUseJvmChmod, revert, runArchiveFinalizers, setArchiveFinalizers, setDefaultDirectoryMode, setDefaultFileMode, setDestFile, setDirectoryMode, setDotFileDirectory, setDuplicateBehavior, setFileMode, setForced, setIgnorePermissions, setIncludeEmptyDirs, setUseJvmChmod, validate
private boolean longWarningGiven
private TarLongFileMode longFileMode
private TarArchiver.TarCompressionMethod compression
private TarArchiver.TarOptions options
private org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tOut
public void setLongfile(TarLongFileMode mode)
mode
- the mode to handle long file names.public void setCompression(TarArchiver.TarCompressionMethod mode)
mode
- the compression method.protected void execute() throws ArchiverException, java.io.IOException
execute
in class AbstractArchiver
ArchiverException
java.io.IOException
protected void tarFile(ArchiveEntry entry, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tOut, java.lang.String vPath) throws ArchiverException, java.io.IOException
entry
- the file to tartOut
- the output streamvPath
- the path name of the file to tarjava.io.IOException
- on errorArchiverException
private java.io.OutputStream compress(TarArchiver.TarCompressionMethod tarCompressionMethod, java.io.OutputStream ostream) throws java.io.IOException
java.io.IOException
public boolean isSupportingForced()
Archiver
Archiver.setForced(boolean)
to true.isSupportingForced
in interface Archiver
isSupportingForced
in class AbstractArchiver
Archiver.setForced(boolean)
,
Archiver.isForced()
protected void cleanUp() throws java.io.IOException
cleanUp
in class AbstractArchiver
java.io.IOException
protected void close() throws java.io.IOException
close
in class AbstractArchiver
java.io.IOException
protected java.lang.String getArchiveType()
getArchiveType
in class AbstractArchiver