org.codehaus.plexus.archiver
Interface Archiver

All Known Implementing Classes:
AbstractArchiver

public interface Archiver

Version:
$Revision: 8217 $ $Date: 2009-05-26 20:56:55 -0400 (Tue, 26 May 2009) $

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 java.lang.String DUPLICATES_ADD
           
static java.lang.String DUPLICATES_FAIL
           
static java.lang.String DUPLICATES_PRESERVE
           
static java.lang.String DUPLICATES_SKIP
           
static java.util.Set DUPLICATES_VALID_BEHAVIORS
           
static java.lang.String ROLE
           
 
Method Summary
 void addArchivedFileSet(ArchivedFileSet fileSet)
          Adds the given archive file set to the archive.
 void addArchivedFileSet(java.io.File archiveFile)
           
 void addArchivedFileSet(java.io.File archiveFile, java.lang.String prefix)
           
 void addArchivedFileSet(java.io.File archiveFile, java.lang.String[] includes, java.lang.String[] excludes)
           
 void addArchivedFileSet(java.io.File archiveFile, java.lang.String prefix, java.lang.String[] includes, java.lang.String[] excludes)
           
 void addDirectory(java.io.File directory)
          Obsolete, use addFileSet(FileSet).
 void addDirectory(java.io.File directory, java.lang.String prefix)
          Obsolete, use addFileSet(FileSet).
 void addDirectory(java.io.File directory, java.lang.String[] includes, java.lang.String[] excludes)
          Obsolete, use addFileSet(FileSet).
 void addDirectory(java.io.File directory, java.lang.String prefix, java.lang.String[] includes, java.lang.String[] excludes)
          Obsolete, use addFileSet(FileSet).
 void addFile(java.io.File inputFile, java.lang.String destFileName)
           
 void addFile(java.io.File inputFile, java.lang.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, java.lang.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()
           
 java.io.File getDestFile()
           
 int getDirectoryMode()
           
 java.lang.String getDuplicateBehavior()
          Returns the behavior of this archiver when duplicate files are detected.
 int getFileMode()
           
 java.util.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 isSupportingForced()
          Returns, whether the archive supports uptodate checks.
 void setDefaultDirectoryMode(int mode)
           
 void setDefaultFileMode(int mode)
           
 void setDestFile(java.io.File destFile)
           
 void setDirectoryMode(int mode)
           
 void setDotFileDirectory(java.io.File dotFileDirectory)
           
 void setDuplicateBehavior(java.lang.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 setIncludeEmptyDirs(boolean includeEmptyDirs)
           
 

Field Detail

DEFAULT_DIR_MODE

public static final int DEFAULT_DIR_MODE
Default value for the dirmode attribute.

See Also:
Constant Field Values

DEFAULT_FILE_MODE

public static final int DEFAULT_FILE_MODE
Default value for the filemode attribute.

See Also:
Constant Field Values

ROLE

public static final java.lang.String ROLE

DUPLICATES_ADD

public static final java.lang.String DUPLICATES_ADD
See Also:
Constant Field Values

DUPLICATES_PRESERVE

public static final java.lang.String DUPLICATES_PRESERVE
See Also:
Constant Field Values

DUPLICATES_SKIP

public static final java.lang.String DUPLICATES_SKIP
See Also:
Constant Field Values

DUPLICATES_FAIL

public static final java.lang.String DUPLICATES_FAIL
See Also:
Constant Field Values

DUPLICATES_VALID_BEHAVIORS

public static final java.util.Set DUPLICATES_VALID_BEHAVIORS
Method Detail

createArchive

public void createArchive()
                   throws ArchiverException,
                          java.io.IOException
Throws:
ArchiverException
java.io.IOException

addDirectory

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

Throws:
ArchiverException

addDirectory

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

Throws:
ArchiverException

addDirectory

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

Throws:
ArchiverException

addDirectory

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

Throws:
ArchiverException

addFileSet

public 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

public void addFile(java.io.File inputFile,
                    java.lang.String destFileName)
             throws ArchiverException
Throws:
ArchiverException

addFile

public void addFile(java.io.File inputFile,
                    java.lang.String destFileName,
                    int permissions)
             throws ArchiverException
Throws:
ArchiverException

addArchivedFileSet

public void addArchivedFileSet(java.io.File archiveFile)
                        throws ArchiverException
Throws:
ArchiverException

addArchivedFileSet

public void addArchivedFileSet(java.io.File archiveFile,
                               java.lang.String prefix)
                        throws ArchiverException
Throws:
ArchiverException

addArchivedFileSet

public void addArchivedFileSet(java.io.File archiveFile,
                               java.lang.String[] includes,
                               java.lang.String[] excludes)
                        throws ArchiverException
Throws:
ArchiverException

addArchivedFileSet

public void addArchivedFileSet(java.io.File archiveFile,
                               java.lang.String prefix,
                               java.lang.String[] includes,
                               java.lang.String[] excludes)
                        throws ArchiverException
Throws:
ArchiverException

addArchivedFileSet

public 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

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

Throws:
ArchiverException
Since:
1.0-alpha-10

addResources

public 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

public java.io.File getDestFile()

setDestFile

public void setDestFile(java.io.File destFile)

setFileMode

public void setFileMode(int mode)

getFileMode

public int getFileMode()

getOverrideFileMode

public int getOverrideFileMode()

setDefaultFileMode

public void setDefaultFileMode(int mode)

getDefaultFileMode

public int getDefaultFileMode()

setDirectoryMode

public void setDirectoryMode(int mode)

getDirectoryMode

public int getDirectoryMode()

getOverrideDirectoryMode

public int getOverrideDirectoryMode()

setDefaultDirectoryMode

public void setDefaultDirectoryMode(int mode)

getDefaultDirectoryMode

public int getDefaultDirectoryMode()

getIncludeEmptyDirs

public boolean getIncludeEmptyDirs()

setIncludeEmptyDirs

public void setIncludeEmptyDirs(boolean includeEmptyDirs)

setDotFileDirectory

public void setDotFileDirectory(java.io.File dotFileDirectory)

getResources

public 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

public java.util.Map getFiles()
Deprecated. Use getResources()


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

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

isSupportingForced

public 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

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


setDuplicateBehavior

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

See DUPLICATES_ADD, DUPLICATES_SKIP, DUPLICATES_PRESERVE, DUPLICATES_FAIL.



Copyright © 2001-2009 Codehaus. All Rights Reserved.