|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.plexus.logging.AbstractLogEnabled
org.codehaus.plexus.archiver.AbstractArchiver
public abstract class AbstractArchiver
| Field Summary |
|---|
| Fields inherited from interface org.codehaus.plexus.archiver.Archiver |
|---|
DEFAULT_DIR_MODE, DEFAULT_FILE_MODE, DUPLICATES_ADD, DUPLICATES_FAIL, DUPLICATES_PRESERVE, DUPLICATES_SKIP, DUPLICATES_VALID_BEHAVIORS, ROLE |
| Constructor Summary | |
|---|---|
AbstractArchiver()
|
|
| 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 |
addArchiveFinalizer(ArchiveFinalizer finalizer)
|
void |
addDirectory(java.io.File directory)
Obsolete, use Archiver.addFileSet(FileSet). |
void |
addDirectory(java.io.File directory,
java.lang.String prefix)
Obsolete, use Archiver.addFileSet(FileSet). |
void |
addDirectory(java.io.File directory,
java.lang.String[] includes,
java.lang.String[] excludes)
Obsolete, use Archiver.addFileSet(FileSet). |
void |
addDirectory(java.io.File directory,
java.lang.String prefix,
java.lang.String[] includes,
java.lang.String[] excludes)
Obsolete, use Archiver.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 collection)
Adds a resource collection to the archive. |
protected ArchiveEntry |
asArchiveEntry(org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection collection,
org.codehaus.plexus.components.io.resources.PlexusIoResource resource)
|
protected ArchiveEntry |
asArchiveEntry(org.codehaus.plexus.components.io.resources.PlexusIoResource resource,
java.lang.String destFileName,
int permissions)
|
protected org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection |
asResourceCollection(ArchivedFileSet fileSet)
|
protected boolean |
checkForced()
|
protected void |
cleanUp()
|
protected abstract void |
close()
|
void |
contextualize(org.codehaus.plexus.context.Context context)
Allows us to pull the ArchiverManager instance out of the container without causing a chicken-and-egg instantiation/composition problem. |
void |
createArchive()
|
protected abstract void |
execute()
|
protected java.util.List |
getArchiveFinalizers()
|
protected abstract java.lang.String |
getArchiveType()
|
int |
getDefaultDirectoryMode()
|
int |
getDefaultFileMode()
|
java.io.File |
getDestFile()
|
int |
getDirectoryMode()
|
java.util.Map |
getDirs()
|
java.lang.String |
getDuplicateBehavior()
Returns the behavior of this archiver when duplicate files are detected. |
int |
getFileMode()
|
java.util.Map |
getFiles()
|
boolean |
getIncludeEmptyDirs()
|
protected org.codehaus.plexus.logging.Logger |
getLogger()
|
int |
getOverrideDirectoryMode()
|
int |
getOverrideFileMode()
|
int |
getRawDefaultDirectoryMode()
Deprecated. Use Archiver.getDefaultDirectoryMode(). |
int |
getRawDefaultFileMode()
Deprecated. Use Archiver.getDefaultFileMode(). |
ResourceIterator |
getResources()
Returns an iterator over instances of ArchiveEntry,
which have previously been added by calls to
Archiver.addResources(PlexusIoResourceCollection),
Archiver.addResource(PlexusIoResource, String, int),
Archiver.addFileSet(FileSet), etc. |
protected boolean |
hasVirtualFiles()
|
boolean |
isForced()
Returns, whether recreating the archive is forced (default). |
boolean |
isSupportingForced()
Returns, whether the archive supports uptodate checks. |
protected boolean |
isUptodate()
|
protected boolean |
revert(java.lang.StringBuffer messageBuffer)
|
protected void |
runArchiveFinalizers()
|
void |
setArchiveFilters(java.util.List filters)
|
void |
setArchiveFinalizers(java.util.List archiveFinalizers)
|
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)
|
protected void |
validate()
|
| Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled |
|---|
enableLogging, setupLogger, setupLogger, setupLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractArchiver()
| Method Detail |
|---|
public java.lang.String getDuplicateBehavior()
Archiver
getDuplicateBehavior in interface Archiverpublic void setDuplicateBehavior(java.lang.String duplicate)
ArchiverArchiverExceptionArchiver.DUPLICATES_ADD, Archiver.DUPLICATES_SKIP, Archiver.DUPLICATES_PRESERVE,
Archiver.DUPLICATES_FAIL.
setDuplicateBehavior in interface Archiverpublic final void setFileMode(int mode)
setFileMode in interface Archiverpublic final void setDefaultFileMode(int mode)
setDefaultFileMode in interface Archiverpublic final int getOverrideFileMode()
getOverrideFileMode in interface Archiverpublic final int getFileMode()
getFileMode in interface Archiverpublic final int getDefaultFileMode()
getDefaultFileMode in interface Archiverpublic final int getRawDefaultFileMode()
Archiver.getDefaultFileMode().
public final void setDirectoryMode(int mode)
setDirectoryMode in interface Archiverpublic final void setDefaultDirectoryMode(int mode)
setDefaultDirectoryMode in interface Archiverpublic final int getOverrideDirectoryMode()
getOverrideDirectoryMode in interface Archiverpublic final int getDirectoryMode()
getDirectoryMode in interface Archiverpublic final int getDefaultDirectoryMode()
getDefaultDirectoryMode in interface Archiverpublic final int getRawDefaultDirectoryMode()
Archiver.getDefaultDirectoryMode().
public boolean getIncludeEmptyDirs()
getIncludeEmptyDirs in interface Archiverpublic void setIncludeEmptyDirs(boolean includeEmptyDirs)
setIncludeEmptyDirs in interface Archiver
public void addDirectory(java.io.File directory)
throws ArchiverException
ArchiverArchiver.addFileSet(FileSet).
addDirectory in interface ArchiverArchiverException
public void addDirectory(java.io.File directory,
java.lang.String prefix)
throws ArchiverException
ArchiverArchiver.addFileSet(FileSet).
addDirectory in interface ArchiverArchiverException
public void addDirectory(java.io.File directory,
java.lang.String[] includes,
java.lang.String[] excludes)
throws ArchiverException
ArchiverArchiver.addFileSet(FileSet).
addDirectory in interface ArchiverArchiverException
public void addDirectory(java.io.File directory,
java.lang.String prefix,
java.lang.String[] includes,
java.lang.String[] excludes)
throws ArchiverException
ArchiverArchiver.addFileSet(FileSet).
addDirectory in interface ArchiverArchiverException
public void addFileSet(FileSet fileSet)
throws ArchiverException
ArchiverArchiver.addDirectory(File),
Archiver.addDirectory(File, String), Archiver.addDirectory(File, String[], String[]),
and Archiver.addDirectory(File, String, String[], String[]). However, as these
methods are in widespread use, they cannot easily be made deprecated.
addFileSet in interface ArchiverArchiverException - Adding the file set failed.
public void addFile(java.io.File inputFile,
java.lang.String destFileName)
throws ArchiverException
addFile in interface ArchiverArchiverException
protected ArchiveEntry asArchiveEntry(org.codehaus.plexus.components.io.resources.PlexusIoResource resource,
java.lang.String destFileName,
int permissions)
throws ArchiverException
ArchiverException
protected ArchiveEntry asArchiveEntry(org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection collection,
org.codehaus.plexus.components.io.resources.PlexusIoResource resource)
throws ArchiverException
ArchiverException
public void addResource(org.codehaus.plexus.components.io.resources.PlexusIoResource resource,
java.lang.String destFileName,
int permissions)
throws ArchiverException
Archiver
addResource in interface ArchiverArchiverException
public void addFile(java.io.File inputFile,
java.lang.String destFileName,
int permissions)
throws ArchiverException
addFile in interface ArchiverArchiverException
public ResourceIterator getResources()
throws ArchiverException
ArchiverArchiveEntry,
which have previously been added by calls to
Archiver.addResources(PlexusIoResourceCollection),
Archiver.addResource(PlexusIoResource, String, int),
Archiver.addFileSet(FileSet), etc.
getResources in interface ArchiverArchiverExceptionpublic java.util.Map getFiles()
getFiles in interface Archiverpublic java.io.File getDestFile()
getDestFile in interface Archiverpublic void setDestFile(java.io.File destFile)
setDestFile in interface Archiverprotected org.codehaus.plexus.logging.Logger getLogger()
getLogger in class org.codehaus.plexus.logging.AbstractLogEnabledpublic java.util.Map getDirs()
protected org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection asResourceCollection(ArchivedFileSet fileSet)
throws ArchiverException
ArchiverException
public void addResources(org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection collection)
throws ArchiverException
addResources in interface ArchiverArchiverException
public void addArchivedFileSet(ArchivedFileSet fileSet)
throws ArchiverException
ArchiverArchiver.addArchivedFileSet(File),
Archiver.addArchivedFileSet(File, String[], String[]), and
Archiver.addArchivedFileSet(File, String, String[], String[]).
However, as these methods are in widespread use, they cannot easily
be made deprecated.
addArchivedFileSet in interface ArchiverArchiverException
public void addArchivedFileSet(java.io.File archiveFile,
java.lang.String prefix,
java.lang.String[] includes,
java.lang.String[] excludes)
throws ArchiverException
addArchivedFileSet in interface ArchiverArchiverException
public void addArchivedFileSet(java.io.File archiveFile,
java.lang.String prefix)
throws ArchiverException
addArchivedFileSet in interface ArchiverArchiverException
public void addArchivedFileSet(java.io.File archiveFile,
java.lang.String[] includes,
java.lang.String[] excludes)
throws ArchiverException
addArchivedFileSet in interface ArchiverArchiverException
public void addArchivedFileSet(java.io.File archiveFile)
throws ArchiverException
addArchivedFileSet in interface ArchiverArchiverException
public void contextualize(org.codehaus.plexus.context.Context context)
throws org.codehaus.plexus.context.ContextException
contextualize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizableorg.codehaus.plexus.context.ContextExceptionpublic boolean isForced()
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 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
Archiver.isSupportingForced() may be called to check whether an
archiver does support uptodate checks.
isForced in interface ArchiverArchiver.setForced(boolean),
Archiver.isSupportingForced()public void setForced(boolean forced)
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 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
Archiver.isSupportingForced() may be called to check whether an
archiver does support uptodate checks.
setForced in interface Archiverforced - True, if the target archive should always be created; false
otherwiseArchiver.isForced(),
Archiver.isSupportingForced()public void setArchiveFilters(java.util.List filters)
setArchiveFilters in interface FilterEnabledpublic void addArchiveFinalizer(ArchiveFinalizer finalizer)
addArchiveFinalizer in interface FinalizerEnabledpublic void setArchiveFinalizers(java.util.List archiveFinalizers)
setArchiveFinalizers in interface FinalizerEnabledpublic void setDotFileDirectory(java.io.File dotFileDirectory)
setDotFileDirectory in interface Archiver
protected boolean isUptodate()
throws ArchiverException
ArchiverException
protected boolean checkForced()
throws ArchiverException
ArchiverExceptionpublic boolean isSupportingForced()
ArchiverArchiver.setForced(boolean) to true.
isSupportingForced in interface ArchiverArchiver.setForced(boolean),
Archiver.isForced()protected java.util.List getArchiveFinalizers()
protected void runArchiveFinalizers()
throws ArchiverException
ArchiverException
public final void createArchive()
throws ArchiverException,
java.io.IOException
createArchive in interface ArchiverArchiverException
java.io.IOExceptionprotected boolean hasVirtualFiles()
protected boolean revert(java.lang.StringBuffer messageBuffer)
protected void validate()
throws ArchiverException,
java.io.IOException
ArchiverException
java.io.IOExceptionprotected abstract java.lang.String getArchiveType()
protected abstract void close()
throws java.io.IOException
java.io.IOExceptionprotected void cleanUp()
protected abstract void execute()
throws ArchiverException,
java.io.IOException
ArchiverException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||