org.codehaus.plexus.archiver
Interface Archiver

All Known Implementing Classes:
AbstractArchiver, AbstractZipArchiver, BZip2Archiver, DirectoryArchiver, EarArchiver, GZipArchiver, JarArchiver, TarArchiver, WarArchiver, ZipArchiver

public interface Archiver

Version:
$Revision$ $Date$

Field Summary
static int DEFAULT_DIR_MODE
          Default value for the dirmode attribute.
static int DEFAULT_FILE_MODE
          Default value for the filemode attribute.
static String DUPLICATES_ADD
           
static String DUPLICATES_FAIL
           
static String DUPLICATES_PRESERVE
           
static String DUPLICATES_SKIP
           
static Set DUPLICATES_VALID_BEHAVIORS
           
static String ROLE
           
 
Method Summary
 void addArchivedFileSet(ArchivedFileSet fileSet)
          Adds the given archive file set to the archive.
 void addArchivedFileSet(File archiveFile)
           
 void addArchivedFileSet(File archiveFile, String prefix)
           
 void addArchivedFileSet(File archiveFile, String[] includes, String[] excludes)
           
 void addArchivedFileSet(File archiveFile, String prefix, String[] includes, String[] excludes)
           
 void addDirectory(File directory)
          Obsolete, use addFileSet(FileSet).
 void addDirectory(File directory, String prefix)
          Obsolete, use addFileSet(FileSet).
 void addDirectory(File directory, String[] includes, String[] excludes)
          Obsolete, use addFileSet(FileSet).
 void addDirectory(File directory, String prefix, String[] includes, String[] excludes)
          Obsolete, use addFileSet(FileSet).
 void addFile(File inputFile, String destFileName)
           
 void addFile(File inputFile, String destFileName, int permissions)
           
 void addFileSet(FileSet fileSet)
          Adds the given file set to the archive.
 void addResource(org.codehaus.plexus.components.io.resources.PlexusIoResource resource, String destFileName, int permissions)
          Adds the given resource collection to the archive.
 void addResources(org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection resources)
          Adds the given resource collection to the archive.
 void createArchive()
           
 int getDefaultDirectoryMode()
           
 int getDefaultFileMode()
           
 File getDestFile()
           
 int getDirectoryMode()
           
 String getDuplicateBehavior()
          Returns the behavior of this archiver when duplicate files are detected.
 int getFileMode()
           
 Map getFiles()
          Deprecated. Use getResources()
 boolean getIncludeEmptyDirs()
           
 int getOverrideDirectoryMode()
           
 int getOverrideFileMode()
           
 ResourceIterator getResources()
          Returns an iterator over instances of ArchiveEntry, which have previously been added by calls to addResources(PlexusIoResourceCollection), addResource(PlexusIoResource, String, int), addFileSet(FileSet), etc.
 boolean isForced()
           Returns, whether recreating the archive is forced (default).
 boolean isIgnorePermissions()
           
 boolean isSupportingForced()
          Returns, whether the archive supports uptodate checks.
 boolean isUseJvmChmod()
           
 void setDefaultDirectoryMode(int mode)
           
 void setDefaultFileMode(int mode)
           
 void setDestFile(File destFile)
           
 void setDirectoryMode(int mode)
           
 void setDotFileDirectory(File dotFileDirectory)
           
 void setDuplicateBehavior(String duplicate)
          Set the behavior of this archiver when duplicate files are detected.
 void setFileMode(int mode)
           
 void setForced(boolean forced)
           Sets, whether recreating the archive is forced (default).
 void setIgnorePermissions(boolean ignorePermissions)
           
 void setIncludeEmptyDirs(boolean includeEmptyDirs)
           
 void setUseJvmChmod(boolean useJvmChmod)
          to use or not the jvm method for file permissions : user all not active for group permissions
 

Field Detail

DEFAULT_DIR_MODE

static final int DEFAULT_DIR_MODE
Default value for the dirmode attribute.

See Also:
Constant Field Values

DEFAULT_FILE_MODE

static final int DEFAULT_FILE_MODE
Default value for the filemode attribute.

See Also:
Constant Field Values

ROLE

static final String ROLE

DUPLICATES_ADD

static final String DUPLICATES_ADD
See Also:
Constant Field Values

DUPLICATES_PRESERVE

static final String DUPLICATES_PRESERVE
See Also:
Constant Field Values

DUPLICATES_SKIP

static final String DUPLICATES_SKIP
See Also:
Constant Field Values

DUPLICATES_FAIL

static final String DUPLICATES_FAIL
See Also:
Constant Field Values

DUPLICATES_VALID_BEHAVIORS

static final Set DUPLICATES_VALID_BEHAVIORS
Method Detail

createArchive

void createArchive()
                   throws ArchiverException,
                          IOException
Throws:
ArchiverException
IOException

addDirectory

void addDirectory(File directory)
                  throws ArchiverException
Obsolete, use addFileSet(FileSet).

Throws:
ArchiverException

addDirectory

void addDirectory(File directory,
                  String prefix)
                  throws ArchiverException
Obsolete, use addFileSet(FileSet).

Throws:
ArchiverException

addDirectory

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

Throws:
ArchiverException

addDirectory

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

Throws:
ArchiverException

addFileSet

void addFileSet(FileSet fileSet)
                throws ArchiverException
Adds the given file set to the archive. This method is basically obsoleting addDirectory(File), addDirectory(File, String), addDirectory(File, String[], String[]), and addDirectory(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

addFile

void addFile(File inputFile,
             String destFileName)
             throws ArchiverException
Throws:
ArchiverException

addFile

void addFile(File inputFile,
             String destFileName,
             int permissions)
             throws ArchiverException
Throws:
ArchiverException

addArchivedFileSet

void addArchivedFileSet(File archiveFile)
                        throws ArchiverException
Throws:
ArchiverException

addArchivedFileSet

void addArchivedFileSet(File archiveFile,
                        String prefix)
                        throws ArchiverException
Throws:
ArchiverException

addArchivedFileSet

void addArchivedFileSet(File archiveFile,
                        String[] includes,
                        String[] excludes)
                        throws ArchiverException
Throws:
ArchiverException

addArchivedFileSet

void addArchivedFileSet(File archiveFile,
                        String prefix,
                        String[] includes,
                        String[] excludes)
                        throws ArchiverException
Throws:
ArchiverException

addArchivedFileSet

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

Throws:
ArchiverException
Since:
1.0-alpha-9

addResource

void addResource(org.codehaus.plexus.components.io.resources.PlexusIoResource resource,
                 String destFileName,
                 int permissions)
                 throws ArchiverException
Adds the given resource collection to the archive.

Throws:
ArchiverException
Since:
1.0-alpha-10

addResources

void addResources(org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection resources)
                  throws ArchiverException
Adds the given resource collection to the archive.

Throws:
ArchiverException
Since:
1.0-alpha-10

getDestFile

File getDestFile()

setDestFile

void setDestFile(File destFile)

setFileMode

void setFileMode(int mode)

getFileMode

int getFileMode()

getOverrideFileMode

int getOverrideFileMode()

setDefaultFileMode

void setDefaultFileMode(int mode)

getDefaultFileMode

int getDefaultFileMode()

setDirectoryMode

void setDirectoryMode(int mode)

getDirectoryMode

int getDirectoryMode()

getOverrideDirectoryMode

int getOverrideDirectoryMode()

setDefaultDirectoryMode

void setDefaultDirectoryMode(int mode)

getDefaultDirectoryMode

int getDefaultDirectoryMode()

getIncludeEmptyDirs

boolean getIncludeEmptyDirs()

setIncludeEmptyDirs

void setIncludeEmptyDirs(boolean includeEmptyDirs)

setDotFileDirectory

void setDotFileDirectory(File dotFileDirectory)

getResources

ResourceIterator getResources()
                              throws ArchiverException
Returns an iterator over instances of ArchiveEntry, which have previously been added by calls to addResources(PlexusIoResourceCollection), addResource(PlexusIoResource, String, int), addFileSet(FileSet), etc.

Throws:
ArchiverException
Since:
1.0-alpha-10

getFiles

Map getFiles()
Deprecated. Use getResources()


isForced

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:
setForced(boolean), isSupportingForced()

setForced

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()

isSupportingForced

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

Returns:
True, if the archiver does support uptodate checks, false otherwise
See Also:
setForced(boolean), isForced()

getDuplicateBehavior

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


setDuplicateBehavior

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.


setUseJvmChmod

void setUseJvmChmod(boolean useJvmChmod)
to use or not the jvm method for file permissions : user all not active for group permissions

Parameters:
useJvmChmod -
Since:
1.1

isUseJvmChmod

boolean isUseJvmChmod()
Returns:
Since:
1.1

isIgnorePermissions

boolean isIgnorePermissions()
Since:
1.1

setIgnorePermissions

void setIgnorePermissions(boolean ignorePermissions)
Since:
1.1


Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.