Class DirectoryArchiver
java.lang.Object
org.codehaus.plexus.archiver.AbstractArchiver
org.codehaus.plexus.archiver.dir.DirectoryArchiver
- All Implemented Interfaces:
Archiver, FinalizerEnabled
A plexus archiver implementation that stores the files to archive in a directory.
-
Field Summary
Fields inherited from interface 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 TypeMethodDescriptionprotected voidcleanUp()protected voidclose()protected voidcopyFile(ArchiveEntry entry, String vPath) Copies the specified file to the specified path, creating any ancestor directory structure as necessary.protected voidcreateSymbolicLink(File link, File target) Creates a symbolic link.voidexecute()protected StringReturns what happens to a symbolic link that the file system refuses to create.booleanReturns, whether the archive supports uptodate checks.voidvoidsetSymlinkFailureMode(SymlinkFailureMode symlinkFailureMode) Sets what happens to a symbolic link that the file system refuses to create, for example on Windows without the "Create symbolic links" right or Developer Mode.Methods inherited from class 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
-
DirectoryArchiver
public DirectoryArchiver()Default constructor.
-
-
Method Details
-
getSymlinkFailureMode
Returns what happens to a symbolic link that the file system refuses to create.- Returns:
- the failure mode,
SymlinkFailureMode.COPY_TARGETby default - Since:
- 4.15.0
-
setSymlinkFailureMode
Sets what happens to a symbolic link that the file system refuses to create, for example on Windows without the "Create symbolic links" right or Developer Mode.- Parameters:
symlinkFailureMode- the failure mode- Since:
- 4.15.0
-
createSymbolicLink
Creates a symbolic link. Visible for testing, so a test can simulate a file system that refuses links.- Parameters:
link- the link to createtarget- the link target- Throws:
IOException- if the link cannot be created- Since:
- 4.15.0
-
resetArchiver
- Throws:
IOException
-
execute
- Specified by:
executein classAbstractArchiver- Throws:
ArchiverExceptionIOException
-
copyFile
Copies the specified file to the specified path, creating any ancestor directory structure as necessary.- Parameters:
entry- The file to copy (IOException will be thrown if this does not exist)vPath- The fully qualified path to copy the file to.- Throws:
ArchiverException- If there is a problem creating the directory structureIOException- If there is a problem copying the file
-
cleanUp
- Overrides:
cleanUpin classAbstractArchiver- Throws:
IOException
-
close
- Specified by:
closein classAbstractArchiver- Throws:
IOException
-
getArchiveType
- Specified by:
getArchiveTypein classAbstractArchiver
-
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- Overrides:
isSupportingForcedin classAbstractArchiver- Returns:
- true, if the archiver does support uptodate checks, false otherwise
- See Also:
-