Class NoOpArchiver
- All Implemented Interfaces:
Archiver
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArchivedFileSet(File archiveFile) Deprecated.voidaddArchivedFileSet(File archiveFile, String prefix) Deprecated.voidaddArchivedFileSet(File archiveFile, String[] includes, String[] excludes) Obsolete, useArchiver.addArchivedFileSet(ArchivedFileSet).voidaddArchivedFileSet(File archiveFile, String prefix, String[] includes, String[] excludes) Deprecated.voidaddArchivedFileSet(ArchivedFileSet fileSet) Adds the given archive file set to the archive.voidaddArchivedFileSet(ArchivedFileSet fileSet, Charset charset) Adds the given archive file set to the archive.voidaddDirectory(File directory) Obsolete, useArchiver.addFileSet(FileSet).voidaddDirectory(File directory, String prefix) Obsolete, useArchiver.addFileSet(FileSet).voidaddDirectory(File directory, String[] includes, String[] excludes) Deprecated.voidaddDirectory(File directory, String prefix, String[] includes, String[] excludes) Deprecated.voidvoidvoidaddFileSet(FileSet fileSet) Adds the given file set to the archive.voidaddResource(org.codehaus.plexus.components.io.resources.PlexusIoResource resource, String destFileName, int permissions) Adds the given resource collection to the archive.voidaddResources(org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection resources) Adds the given resource collection to the archive.voidaddSymlink(String symlinkName, int permissions, String symlinkDestination) voidaddSymlink(String symlinkName, String symlinkDestination) voidconfigureReproducible(Date lastModifiedDate) Deprecated.voidconfigureReproducibleBuild(FileTime lastModifiedTime) Configure the archiver to create archives in a reproducible way (see Reproducible Builds).voidintintintGets the forced mode for directories, falling back to default if none is forced.Returns the behavior of this archiver when duplicate files are detected.intgetFiles()Deprecated.booleanDeprecated.UsegetLastModifiedTime()instead.Returns the last modification time of the archiver.intintintintReturns an iterator over instances ofArchiveEntry, which have previously been added by calls toArchiver.addResources(PlexusIoResourceCollection),Archiver.addResource(PlexusIoResource, String, int),Archiver.addFileSet(FileSet), etc.intgetUmask()booleanisForced()Returns, whether recreating the archive is forced (default).booleanbooleanReturns, whether the archive supports uptodate checks.booleanDeprecated.voidsetDefaultDirectoryMode(int mode) This is the "default" value we should use if no other value is specifiedvoidsetDefaultFileMode(int mode) voidsetDestFile(File destFile) voidsetDirectoryMode(int mode) This is the forced mode that should be used regardless if set, otherwise falls back to default.voidsetDotFileDirectory(File dotFileDirectory) voidsetDuplicateBehavior(String duplicate) Set the behavior of this archiver when duplicate files are detected.voidsetFileMode(int mode) voidsetFilenameComparator(Comparator<String> filenameComparator) Set filename comparator, used to sort file entries when scanning directories since File.list() does not guarantee any order.voidsetForced(boolean forced) Sets, whether recreating the archive is forced (default).voidsetIgnorePermissions(boolean ignorePermissions) voidsetIncludeEmptyDirs(boolean includeEmptyDirs) voidsetLastModifiedDate(Date lastModifiedDate) Deprecated.UsesetLastModifiedTime(FileTime)instead.voidsetLastModifiedTime(FileTime lastModifiedTime) Sets the last modification time of the entries (if non null).voidsetOverrideGid(int gid) voidsetOverrideGroupName(String groupName) voidsetOverrideUid(int uid) voidsetOverrideUserName(String userName) voidsetUmask(int umask) voidsetUseJvmChmod(boolean useJvmChmod) Deprecated.
-
Constructor Details
-
NoOpArchiver
public NoOpArchiver()
-
-
Method Details
-
createArchive
- Specified by:
createArchivein interfaceArchiver- Throws:
ArchiverExceptionIOException
-
addDirectory
Description copied from interface:ArchiverObsolete, useArchiver.addFileSet(FileSet).- Specified by:
addDirectoryin interfaceArchiver- Throws:
ArchiverException
-
addDirectory
Description copied from interface:ArchiverObsolete, useArchiver.addFileSet(FileSet).- Specified by:
addDirectoryin interfaceArchiver- Throws:
ArchiverException
-
addDirectory
@Deprecated public void addDirectory(@Nonnull File directory, String[] includes, String[] excludes) throws ArchiverException Deprecated.Description copied from interface:ArchiverObsolete, useArchiver.addFileSet(FileSet).- Specified by:
addDirectoryin interfaceArchiver- Throws:
ArchiverException
-
addDirectory
@Deprecated public void addDirectory(@Nonnull File directory, String prefix, String[] includes, String[] excludes) throws ArchiverException Deprecated.Description copied from interface:ArchiverObsolete, useArchiver.addFileSet(FileSet).- Specified by:
addDirectoryin interfaceArchiver- Throws:
ArchiverException
-
addFileSet
Description copied from interface:ArchiverAdds the given file set to the archive. This method is basically obsoletingArchiver.addDirectory(File),Archiver.addDirectory(File, String),Archiver.addDirectory(File, String[], String[]), andArchiver.addDirectory(File, String, String[], String[]). However, as these methods are in widespread use, they cannot easily be deprecated.- Specified by:
addFileSetin interfaceArchiver- Throws:
ArchiverException- Adding the file set failed.
-
addSymlink
- Specified by:
addSymlinkin interfaceArchiver- Throws:
ArchiverException
-
addSymlink
public void addSymlink(String symlinkName, int permissions, String symlinkDestination) throws ArchiverException - Specified by:
addSymlinkin interfaceArchiver- Throws:
ArchiverException
-
addFile
- Specified by:
addFilein interfaceArchiver- Throws:
ArchiverException
-
addFile
public void addFile(@Nonnull File inputFile, @Nonnull String destFileName, int permissions) throws ArchiverException - Specified by:
addFilein interfaceArchiver- Throws:
ArchiverException
-
addArchivedFileSet
Deprecated.Description copied from interface:ArchiverObsolete, useArchiver.addArchivedFileSet(ArchivedFileSet).- Specified by:
addArchivedFileSetin interfaceArchiver- Throws:
ArchiverException
-
addArchivedFileSet
@Deprecated public void addArchivedFileSet(@Nonnull File archiveFile, String prefix) throws ArchiverException Deprecated.Description copied from interface:ArchiverObsolete, useArchiver.addArchivedFileSet(ArchivedFileSet).- Specified by:
addArchivedFileSetin interfaceArchiver- Throws:
ArchiverException
-
addArchivedFileSet
public void addArchivedFileSet(File archiveFile, String[] includes, String[] excludes) throws ArchiverException Description copied from interface:ArchiverObsolete, useArchiver.addArchivedFileSet(ArchivedFileSet).- Specified by:
addArchivedFileSetin interfaceArchiver- Throws:
ArchiverException
-
addArchivedFileSet
@Deprecated public void addArchivedFileSet(@Nonnull File archiveFile, String prefix, String[] includes, String[] excludes) throws ArchiverException Deprecated.Description copied from interface:ArchiverObsolete, useArchiver.addArchivedFileSet(ArchivedFileSet).- Specified by:
addArchivedFileSetin interfaceArchiver- Throws:
ArchiverException
-
addArchivedFileSet
Description copied from interface:ArchiverAdds the given archive file set to the archive. This method is basically obsoletingArchiver.addArchivedFileSet(File),Archiver.addArchivedFileSet(File, String[], String[]), andArchiver.addArchivedFileSet(File, String, String[], String[]). However, as these methods are in widespread use, they cannot easily be deprecated. Stream transformers are supported on this method- Specified by:
addArchivedFileSetin interfaceArchiver- Throws:
ArchiverException
-
addArchivedFileSet
Description copied from interface:ArchiverAdds the given archive file set to the archive. This method is basically obsoletingArchiver.addArchivedFileSet(File),Archiver.addArchivedFileSet(File, String[], String[]), andArchiver.addArchivedFileSet(File, String, String[], String[]). However, as these methods are in widespread use, they cannot easily be deprecated.- Specified by:
addArchivedFileSetin interfaceArchiver- Parameters:
fileSet- the fileSet to addcharset- the encoding to use, particularly useful to specific non-standard filename encodings for some kinds of archives (for instance zip files) Stream transformers are supported on this method- Throws:
ArchiverException
-
addResource
public void addResource(org.codehaus.plexus.components.io.resources.PlexusIoResource resource, String destFileName, int permissions) throws ArchiverException Description copied from interface:ArchiverAdds the given resource collection to the archive. Stream transformers are *not* supported on this method- Specified by:
addResourcein interfaceArchiver- Throws:
ArchiverException
-
addResources
public void addResources(org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection resources) throws ArchiverException Description copied from interface:ArchiverAdds the given resource collection to the archive. Stream transformers are supported on this method- Specified by:
addResourcesin interfaceArchiver- Throws:
ArchiverException
-
getDestFile
- Specified by:
getDestFilein interfaceArchiver
-
setDestFile
- Specified by:
setDestFilein interfaceArchiver
-
setFileMode
public void setFileMode(int mode) - Specified by:
setFileModein interfaceArchiver
-
getFileMode
public int getFileMode()- Specified by:
getFileModein interfaceArchiver
-
getOverrideFileMode
public int getOverrideFileMode()- Specified by:
getOverrideFileModein interfaceArchiver
-
setDefaultFileMode
public void setDefaultFileMode(int mode) - Specified by:
setDefaultFileModein interfaceArchiver
-
getDefaultFileMode
public int getDefaultFileMode()- Specified by:
getDefaultFileModein interfaceArchiver
-
setDirectoryMode
public void setDirectoryMode(int mode) Description copied from interface:ArchiverThis is the forced mode that should be used regardless if set, otherwise falls back to default.- Specified by:
setDirectoryModein interfaceArchiver- Parameters:
mode-
-
getDirectoryMode
public int getDirectoryMode()Description copied from interface:ArchiverGets the forced mode for directories, falling back to default if none is forced.- Specified by:
getDirectoryModein interfaceArchiver- Returns:
-
getOverrideDirectoryMode
public int getOverrideDirectoryMode()- Specified by:
getOverrideDirectoryModein interfaceArchiver
-
setDefaultDirectoryMode
public void setDefaultDirectoryMode(int mode) Description copied from interface:ArchiverThis is the "default" value we should use if no other value is specified- Specified by:
setDefaultDirectoryModein interfaceArchiver- Parameters:
mode-
-
getDefaultDirectoryMode
public int getDefaultDirectoryMode()- Specified by:
getDefaultDirectoryModein interfaceArchiver
-
getIncludeEmptyDirs
public boolean getIncludeEmptyDirs()- Specified by:
getIncludeEmptyDirsin interfaceArchiver
-
setIncludeEmptyDirs
public void setIncludeEmptyDirs(boolean includeEmptyDirs) - Specified by:
setIncludeEmptyDirsin interfaceArchiver
-
setDotFileDirectory
- Specified by:
setDotFileDirectoryin interfaceArchiver
-
getResources
Description copied from interface:ArchiverReturns an iterator over instances ofArchiveEntry, which have previously been added by calls toArchiver.addResources(PlexusIoResourceCollection),Archiver.addResource(PlexusIoResource, String, int),Archiver.addFileSet(FileSet), etc.- Specified by:
getResourcesin interfaceArchiver- Throws:
ArchiverException
-
getFiles
Deprecated.Description copied from interface:ArchiverReturns a map of the files that have been added to the archive.Note: The entry names in the map may use platform-specific path separators in the base implementation. However, archive format-specific implementations (such as ZIP-based archivers) should normalize paths according to their format requirements. For example, ZIP archivers normalize to forward slashes as required by the ZIP file specification.
-
isForced
public boolean isForced()Description copied from interface:ArchiverReturns, whether recreating the archive is forced (default). Setting this option to false means, that the archiver should compare the timestamps of included files with the timestamp of the target archive and rebuild the archive only, if the latter timestamp precedes the former timestamps. Checking for timestamps will typically offer a performance gain (in particular, if the following steps in a build can be suppressed, if an archive isn't recreated) on the cost that you get inaccurate results from time to time. In particular, removal of source files won't be detected.
An archiver doesn't necessarily support checks for uptodate. If so, setting this option to true will simply be ignored. The method
Archiver.isSupportingForced()may be called to check whether an archiver does support uptodate checks. -
setForced
public void setForced(boolean forced) Description copied from interface:ArchiverSets, whether recreating the archive is forced (default). Setting this option to false means, that the archiver should compare the timestamps of included files with the timestamp of the target archive and rebuild the archive only, if the latter timestamp precedes the former timestamps. Checking for timestamps will typically offer a performance gain (in particular, if the following steps in a build can be suppressed, if an archive isn't recreated) on the cost that you get inaccurate results from time to time. In particular, removal of source files won't be detected.
An archiver doesn't necessarily support checks for uptodate. If so, setting this option to true will simply be ignored. The method
Archiver.isSupportingForced()may be called to check whether an archiver does support uptodate checks. -
isSupportingForced
public boolean isSupportingForced()Description copied from interface:ArchiverReturns, whether the archive supports uptodate checks. If so, you may setArchiver.setForced(boolean)to true.- Specified by:
isSupportingForcedin interfaceArchiver- Returns:
- true, if the archiver does support uptodate checks, false otherwise
- See Also:
-
getDuplicateBehavior
Description copied from interface:ArchiverReturns the behavior of this archiver when duplicate files are detected.- Specified by:
getDuplicateBehaviorin interfaceArchiver
-
setDuplicateBehavior
Description copied from interface:ArchiverSet the behavior of this archiver when duplicate files are detected. One of:
- add - Add the duplicates to the archive as duplicate entries
- skip/preserve - Leave the first entry encountered in the archive, skip the new one
- fail - throw an
ArchiverException
SeeArchiver.DUPLICATES_ADD,Archiver.DUPLICATES_SKIP,Archiver.DUPLICATES_PRESERVE,Archiver.DUPLICATES_FAIL.- Specified by:
setDuplicateBehaviorin interfaceArchiver
-
setUseJvmChmod
Deprecated.Description copied from interface:Archiverto use or not the jvm method for file permissions: user all not active for group permissions- Specified by:
setUseJvmChmodin interfaceArchiver- Parameters:
useJvmChmod-
-
isUseJvmChmod
Deprecated.- Specified by:
isUseJvmChmodin interfaceArchiver- Returns:
-
isIgnorePermissions
public boolean isIgnorePermissions()- Specified by:
isIgnorePermissionsin interfaceArchiver
-
setIgnorePermissions
public void setIgnorePermissions(boolean ignorePermissions) - Specified by:
setIgnorePermissionsin interfaceArchiver
-
setLastModifiedDate
Deprecated.UsesetLastModifiedTime(FileTime)instead.Description copied from interface:ArchiverDefine forced last modification date for entries (if non null).- Specified by:
setLastModifiedDatein interfaceArchiver- Parameters:
lastModifiedDate-
-
getLastModifiedDate
Deprecated.UsegetLastModifiedTime()instead.- Specified by:
getLastModifiedDatein interfaceArchiver
-
setLastModifiedTime
Description copied from interface:ArchiverSets the last modification time of the entries (if non null).- Specified by:
setLastModifiedTimein interfaceArchiver- Parameters:
lastModifiedTime- to set in the archive entries- See Also:
-
getLastModifiedTime
Description copied from interface:ArchiverReturns the last modification time of the archiver.- Specified by:
getLastModifiedTimein interfaceArchiver- Returns:
- The last modification time of the archiver, null if not specified
- See Also:
-
setFilenameComparator
Description copied from interface:ArchiverSet filename comparator, used to sort file entries when scanning directories since File.list() does not guarantee any order.- Specified by:
setFilenameComparatorin interfaceArchiver
-
setOverrideUid
public void setOverrideUid(int uid) - Specified by:
setOverrideUidin interfaceArchiver
-
setOverrideUserName
- Specified by:
setOverrideUserNamein interfaceArchiver
-
getOverrideUid
public int getOverrideUid()- Specified by:
getOverrideUidin interfaceArchiver
-
getOverrideUserName
- Specified by:
getOverrideUserNamein interfaceArchiver
-
setOverrideGid
public void setOverrideGid(int gid) - Specified by:
setOverrideGidin interfaceArchiver
-
setOverrideGroupName
- Specified by:
setOverrideGroupNamein interfaceArchiver
-
getOverrideGid
public int getOverrideGid()- Specified by:
getOverrideGidin interfaceArchiver
-
getOverrideGroupName
- Specified by:
getOverrideGroupNamein interfaceArchiver
-
setUmask
public void setUmask(int umask) -
getUmask
public int getUmask() -
configureReproducible
Deprecated.UseconfigureReproducibleBuild(FileTime)instead.Description copied from interface:ArchiverThis method is obsolete and will just callArchiver.configureReproducibleBuild(FileTime)with the Date transformed into FileTime.- Specified by:
configureReproduciblein interfaceArchiver- Parameters:
lastModifiedDate- the date to use for archive entries last modified time
-
configureReproducibleBuild
Description copied from interface:ArchiverConfigure the archiver to create archives in a reproducible way (see Reproducible Builds).This will configure:
- reproducible archive entries order,
- defined entries timestamp
- Specified by:
configureReproducibleBuildin interfaceArchiver- Parameters:
lastModifiedTime- The last modification time of the entries- See Also:
-
configureReproducibleBuild(FileTime)instead.