Package org.codehaus.plexus.archiver.tar
Class TarArchiver
java.lang.Object
org.codehaus.plexus.archiver.AbstractArchiver
org.codehaus.plexus.archiver.tar.TarArchiver
- All Implemented Interfaces:
Archiver
,FinalizerEnabled
- Direct Known Subclasses:
TarBZip2Archiver
,TarGZipArchiver
,TarSnappyArchiver
,TarXZArchiver
,TarZstdArchiver
- Author:
- Emmanuel Venisse
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Valid Modes for Compression attribute to Tar Taskclass
Valid Modes for Compression attribute to Tar Task -
Field Summary
Fields inherited from interface org.codehaus.plexus.archiver.Archiver
DEFAULT_DIR_MODE, DEFAULT_FILE_MODE, DEFAULT_SYMLILNK_MODE, DUPLICATES_ADD, DUPLICATES_FAIL, DUPLICATES_PRESERVE, DUPLICATES_SKIP, DUPLICATES_VALID_BEHAVIORS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
cleanUp()
protected void
close()
protected void
execute()
protected String
boolean
Returns, whether the archive supports uptodate checks.void
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, String vPath) tar a fileMethods inherited from class org.codehaus.plexus.archiver.AbstractArchiver
addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchiveFinalizer, addDirectory, addDirectory, addDirectory, addDirectory, addFile, addFile, addFileSet, addResource, addResources, addSymlink, addSymlink, asArchiveEntry, asResourceCollection, checkForced, configureReproducible, configureReproducibleBuild, createArchive, getDefaultDirectoryMode, getDefaultFileMode, getDestFile, getDirectoryMode, getDuplicateBehavior, getFileMode, getFilenameComparator, getFiles, getIncludeEmptyDirs, getLastModifiedDate, getLastModifiedTime, getLogger, getOverrideDirectoryMode, getOverrideFileMode, getOverrideGid, getOverrideGroupName, getOverrideUid, getOverrideUserName, getRawDefaultFileMode, getResources, getUmask, hasVirtualFiles, isForced, isIgnorePermissions, isUptodate, isUseJvmChmod, normalizeLastModifiedTime, postCreateArchive, revert, runArchiveFinalizers, setArchiveFinalizers, setDefaultDirectoryMode, setDefaultFileMode, setDestFile, setDirectoryMode, setDotFileDirectory, setDuplicateBehavior, setFileMode, setFilenameComparator, setForced, setIgnorePermissions, setIncludeEmptyDirs, setLastModifiedDate, setLastModifiedTime, setOverrideGid, setOverrideGroupName, setOverrideUid, setOverrideUserName, setUmask, setUseJvmChmod, validate
-
Constructor Details
-
TarArchiver
public TarArchiver()
-
-
Method Details
-
setLongfile
Set how to handle long files, those with a path>100 chars. Optional, default=warn.Allowable values are
- truncate - paths are truncated to the maximum length
- fail - paths greater than the maximum cause a build exception
- warn - paths greater than the maximum cause a warning and GNU is used
- gnu - GNU extensions are used for any paths greater than the maximum.
- posix - posix extensions are used for any paths greater than the maximum.
- posixwarn - posix extensions are used (with warning) for any paths greater than the maximum.
- omit - paths greater than the maximum are omitted from the archive
- Parameters:
mode
- the mode to handle long file names.
-
setCompression
Set compression method. Allowable values are- none - no compression
- gzip - Gzip compression
- bzip2 - Bzip2 compression
- Parameters:
mode
- the compression method.
-
execute
- Specified by:
execute
in classAbstractArchiver
- Throws:
ArchiverException
IOException
-
tarFile
protected void tarFile(ArchiveEntry entry, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tOut, String vPath) throws ArchiverException, IOException tar a file- Parameters:
entry
- the file to tartOut
- the output streamvPath
- the path name of the file to tar- Throws:
IOException
- on errorArchiverException
-
isSupportingForced
public boolean isSupportingForced()Description copied from interface:Archiver
Returns, whether the archive supports uptodate checks. If so, you may setArchiver.setForced(boolean)
to true.- Specified by:
isSupportingForced
in interfaceArchiver
- Overrides:
isSupportingForced
in classAbstractArchiver
- Returns:
- true, if the archiver does support uptodate checks, false otherwise
- See Also:
-
cleanUp
- Overrides:
cleanUp
in classAbstractArchiver
- Throws:
IOException
-
close
- Specified by:
close
in classAbstractArchiver
- Throws:
IOException
-
getArchiveType
- Specified by:
getArchiveType
in classAbstractArchiver
-