org.codehaus.plexus.archiver

Interface Archiver

public interface Archiver

Version: $Revision: 8217 $ $Date: 2009-05-27 03:56:55 +0300 (Wed, 27 May 2009) $

Field Summary
intDEFAULT_DIR_MODE
Default value for the dirmode attribute.
intDEFAULT_FILE_MODE
Default value for the filemode attribute.
static StringDUPLICATES_ADD
static StringDUPLICATES_FAIL
static StringDUPLICATES_PRESERVE
static StringDUPLICATES_SKIP
static SetDUPLICATES_VALID_BEHAVIORS
StringROLE
Method Summary
voidaddArchivedFileSet(File archiveFile)
voidaddArchivedFileSet(File archiveFile, String prefix)
voidaddArchivedFileSet(File archiveFile, String[] includes, String[] excludes)
voidaddArchivedFileSet(File archiveFile, String prefix, String[] includes, String[] excludes)
voidaddArchivedFileSet(ArchivedFileSet fileSet)
Adds the given archive file set to the archive.
voidaddDirectory(File directory)
Obsolete, use addFileSet.
voidaddDirectory(File directory, String prefix)
Obsolete, use addFileSet.
voidaddDirectory(File directory, String[] includes, String[] excludes)
Obsolete, use addFileSet.
voidaddDirectory(File directory, String prefix, String[] includes, String[] excludes)
Obsolete, use addFileSet.
voidaddFile(File inputFile, String destFileName)
voidaddFile(File inputFile, String destFileName, int permissions)
voidaddFileSet(FileSet fileSet)
Adds the given file set to the archive.
voidaddResource(PlexusIoResource resource, String destFileName, int permissions)
Adds the given resource collection to the archive.
voidaddResources(PlexusIoResourceCollection resources)
Adds the given resource collection to the archive.
voidcreateArchive()
intgetDefaultDirectoryMode()
intgetDefaultFileMode()
FilegetDestFile()
intgetDirectoryMode()
StringgetDuplicateBehavior()
Returns the behavior of this archiver when duplicate files are detected.
intgetFileMode()
MapgetFiles()
booleangetIncludeEmptyDirs()
intgetOverrideDirectoryMode()
intgetOverrideFileMode()
ResourceIteratorgetResources()
Returns an iterator over instances of ArchiveEntry, which have previously been added by calls to addResources, Archiver, addFileSet, etc.
booleanisForced()

Returns, whether recreating the archive is forced (default).

booleanisSupportingForced()
Returns, whether the archive supports uptodate checks.
voidsetDefaultDirectoryMode(int mode)
voidsetDefaultFileMode(int mode)
voidsetDestFile(File destFile)
voidsetDirectoryMode(int mode)
voidsetDotFileDirectory(File dotFileDirectory)
voidsetDuplicateBehavior(String duplicate)
Set the behavior of this archiver when duplicate files are detected.
voidsetFileMode(int mode)
voidsetForced(boolean forced)

Sets, whether recreating the archive is forced (default).

voidsetIncludeEmptyDirs(boolean includeEmptyDirs)

Field Detail

DEFAULT_DIR_MODE

public int DEFAULT_DIR_MODE
Default value for the dirmode attribute.

DEFAULT_FILE_MODE

public int DEFAULT_FILE_MODE
Default value for the filemode attribute.

DUPLICATES_ADD

public static final String DUPLICATES_ADD

DUPLICATES_FAIL

public static final String DUPLICATES_FAIL

DUPLICATES_PRESERVE

public static final String DUPLICATES_PRESERVE

DUPLICATES_SKIP

public static final String DUPLICATES_SKIP

DUPLICATES_VALID_BEHAVIORS

public static final Set DUPLICATES_VALID_BEHAVIORS

ROLE

public String ROLE

Method Detail

addArchivedFileSet

public void addArchivedFileSet(File archiveFile)

addArchivedFileSet

public void addArchivedFileSet(File archiveFile, String prefix)

addArchivedFileSet

public void addArchivedFileSet(File archiveFile, String[] includes, String[] excludes)

addArchivedFileSet

public void addArchivedFileSet(File archiveFile, String prefix, String[] includes, String[] excludes)

addArchivedFileSet

public void addArchivedFileSet(ArchivedFileSet fileSet)
Adds the given archive file set to the archive. This method is basically obsoleting addArchivedFileSet, (File, String[], String[]), and (File, String, String[], String[]). However, as these methods are in widespread use, they cannot easily be made deprecated.

Since: 1.0-alpha-9

addDirectory

public void addDirectory(File directory)
Obsolete, use addFileSet.

addDirectory

public void addDirectory(File directory, String prefix)
Obsolete, use addFileSet.

addDirectory

public void addDirectory(File directory, String[] includes, String[] excludes)
Obsolete, use addFileSet.

addDirectory

public void addDirectory(File directory, String prefix, String[] includes, String[] excludes)
Obsolete, use addFileSet.

addFile

public void addFile(File inputFile, String destFileName)

addFile

public void addFile(File inputFile, String destFileName, int permissions)

addFileSet

public void addFileSet(FileSet fileSet)
Adds the given file set to the archive. This method is basically obsoleting addDirectory, Archiver, (File, String[], String[]), and (File, String, String[], String[]). However, as these methods are in widespread use, they cannot easily be made deprecated.

Throws: ArchiverException Adding the file set failed.

Since: 1.0-alpha-9

addResource

public void addResource(PlexusIoResource resource, String destFileName, int permissions)
Adds the given resource collection to the archive.

Since: 1.0-alpha-10

addResources

public void addResources(PlexusIoResourceCollection resources)
Adds the given resource collection to the archive.

Since: 1.0-alpha-10

createArchive

public void createArchive()

getDefaultDirectoryMode

public int getDefaultDirectoryMode()

getDefaultFileMode

public int getDefaultFileMode()

getDestFile

public File getDestFile()

getDirectoryMode

public int getDirectoryMode()

getDuplicateBehavior

public String getDuplicateBehavior()
Returns the behavior of this archiver when duplicate files are detected.

getFileMode

public int getFileMode()

getFiles

public Map getFiles()

Deprecated: Use getResources

getIncludeEmptyDirs

public boolean getIncludeEmptyDirs()

getOverrideDirectoryMode

public int getOverrideDirectoryMode()

getOverrideFileMode

public int getOverrideFileMode()

getResources

public ResourceIterator getResources()
Returns an iterator over instances of ArchiveEntry, which have previously been added by calls to addResources, Archiver, addFileSet, etc.

Since: 1.0-alpha-10

isForced

public boolean isForced()

Returns, 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 recrated) 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 isSupportingForced may be called to check whether an archiver does support uptodate checks.

Returns: True, if the target archive should always be created; false otherwise

See Also: Archiver isSupportingForced

isSupportingForced

public boolean isSupportingForced()
Returns, whether the archive supports uptodate checks. If so, you may set Archiver to true.

Returns: True, if the archiver does support uptodate checks, false otherwise

See Also: Archiver isForced

setDefaultDirectoryMode

public void setDefaultDirectoryMode(int mode)

setDefaultFileMode

public void setDefaultFileMode(int mode)

setDestFile

public void setDestFile(File destFile)

setDirectoryMode

public void setDirectoryMode(int mode)

setDotFileDirectory

public void setDotFileDirectory(File dotFileDirectory)

setDuplicateBehavior

public void setDuplicateBehavior(String duplicate)
Set the behavior of this archiver when duplicate files are detected. One of:

See DUPLICATES_ADD, DUPLICATES_SKIP, DUPLICATES_PRESERVE, DUPLICATES_FAIL.

setFileMode

public void setFileMode(int mode)

setForced

public void setForced(boolean forced)

Sets, 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 recrated) 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 isSupportingForced may be called to check whether an archiver does support uptodate checks.

Parameters: forced True, if the target archive should always be created; false otherwise

See Also: isForced isSupportingForced

setIncludeEmptyDirs

public void setIncludeEmptyDirs(boolean includeEmptyDirs)
Copyright © 2001-2009 Codehaus. All Rights Reserved.