public abstract class ArchiveFileSet extends FileSet
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_DIR_MODE
Default value for the dirmode attribute.
|
static int |
DEFAULT_FILE_MODE
Default value for the filemode attribute.
|
description, location, project
Modifier | Constructor and Description |
---|---|
|
ArchiveFileSet()
Constructor for ArchiveFileSet
|
protected |
ArchiveFileSet(ArchiveFileSet fileset)
Constructor using a archive fileset argument.
|
protected |
ArchiveFileSet(FileSet fileset)
Constructor using a fileset argument.
|
Modifier and Type | Method and Description |
---|---|
void |
addConfigured(ResourceCollection a)
Set the source Archive file for the archivefileset.
|
java.lang.Object |
clone()
Return a ArchiveFileSet that has the same properties
as this one.
|
protected void |
configureFileSet(ArchiveFileSet zfs)
A ArchiveFileset accepts another ArchiveFileSet or a FileSet as reference
FileSets are often used by the war task for the lib attribute
|
protected void |
dieOnCircularReference(java.util.Stack<java.lang.Object> stk,
Project p)
Check to see whether any DataType we hold references to is
included in the Stack (which holds all DataType instances that
directly or indirectly reference this instance, including this
instance itself).
|
protected java.lang.Object |
getCheckedRef(Project p)
Performs the check for circular references and returns the
referenced object.
|
DirectoryScanner |
getDirectoryScanner(Project p)
Return the DirectoryScanner associated with this FileSet.
|
int |
getDirMode()
Deprecated.
since 1.7.
|
int |
getDirMode(Project p)
Get the dir mode of the archive fileset
|
java.lang.String |
getEncoding()
Get the encoding used for this ZipFileSet.
|
int |
getFileMode()
Deprecated.
since 1.7.
|
int |
getFileMode(Project p)
Get the mode of the archive fileset
|
java.lang.String |
getFullpath()
Deprecated.
since 1.7.
|
java.lang.String |
getFullpath(Project p)
Return the full pathname of the single entry in this fileset.
|
java.lang.String |
getPrefix()
Deprecated.
since 1.7.
|
java.lang.String |
getPrefix(Project p)
Return the prefix prepended to entries in the archive file.
|
java.io.File |
getSrc()
Get the archive file from which entries will be extracted.
|
java.io.File |
getSrc(Project p)
Get the archive from which entries will be extracted.
|
boolean |
hasDirModeBeenSet()
Whether the user has specified the mode explicitly.
|
boolean |
hasFileModeBeenSet()
Whether the user has specified the mode explicitly.
|
void |
integerSetDirMode(int mode)
specify the user, group and
other modes in the standard Unix fashion;
optional, default=0755
|
void |
integerSetFileMode(int mode)
specify the user, group and
other modes in the standard Unix fashion;
optional, default=0644
|
boolean |
isFilesystemOnly()
Indicate whether this ResourceCollection is composed entirely of
Resources accessible via local filesystem conventions.
|
java.util.Iterator<Resource> |
iterator()
Fulfill the ResourceCollection contract.
|
protected abstract ArchiveScanner |
newArchiveScanner()
Creates a scanner for this type of archive.
|
void |
setDir(java.io.File dir)
Set the directory for the fileset.
|
void |
setDirMode(java.lang.String octalString)
A 3 digit octal string, specify the user, group and
other modes in the standard Unix fashion;
optional, default=0755
|
void |
setEncoding(java.lang.String enc)
Set the encoding used for this ZipFileSet.
|
void |
setErrorOnMissingArchive(boolean errorOnMissingArchive)
Sets whether an error is thrown if an archive does not exist.
|
void |
setFileMode(java.lang.String octalString)
A 3 digit octal string, specify the user, group and
other modes in the standard Unix fashion;
optional, default=0644
|
void |
setFullpath(java.lang.String fullpath)
Set the full pathname of the single entry in this fileset.
|
void |
setPrefix(java.lang.String prefix)
Prepend this prefix to the path for each archive entry.
|
void |
setSrc(java.io.File srcFile)
Set the source Archive file for the archivefileset.
|
void |
setSrcResource(Resource src)
Set the source Archive file for the archivefileset.
|
int |
size()
Fulfill the ResourceCollection contract.
|
java.lang.String |
toString()
For file-based archivefilesets, return the same as for normal filesets;
else just return the path of the zip.
|
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addReadable, addSelector, addSize, addType, addWritable, appendExcludes, appendIncludes, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDefaultexcludes, getDir, getDir, getDirectoryScanner, getErrorOnMissingDir, getMaxLevelsOfSymlinks, getRef, getSelectors, hasPatterns, hasSelectors, isCaseSensitive, isFollowSymlinks, mergeExcludes, mergeIncludes, mergePatterns, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setErrorOnMissingDir, setExcludes, setExcludesfile, setFile, setFollowSymlinks, setIncludes, setIncludesfile, setMaxLevelsOfSymlinks, setRefid, setupDirectoryScanner, setupDirectoryScanner
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
public static final int DEFAULT_DIR_MODE
public static final int DEFAULT_FILE_MODE
public ArchiveFileSet()
protected ArchiveFileSet(FileSet fileset)
fileset
- the fileset to useprotected ArchiveFileSet(ArchiveFileSet fileset)
fileset
- the archivefileset to usepublic void setDir(java.io.File dir) throws BuildException
setDir
in class AbstractFileSet
dir
- the directory for the filesetBuildException
- on errorpublic void addConfigured(ResourceCollection a)
a
- the archive as a single element Resource collection.public void setSrc(java.io.File srcFile)
srcFile
- The archive from which to extract entries.public void setSrcResource(Resource src)
src
- The archive from which to extract entries.public java.io.File getSrc(Project p)
p
- the project to usepublic void setErrorOnMissingArchive(boolean errorOnMissingArchive)
errorOnMissingArchive
- true if missing archives cause errors,
false if not.public java.io.File getSrc()
protected java.lang.Object getCheckedRef(Project p)
AbstractFileSet.getRef(Project)
, because that contains the special support for fileset
references, which can be handled by all ArchiveFileSets.getCheckedRef
in class DataType
p
- the Ant Project instance against which to resolve references.BuildException
- if the reference is invalid (circular ref, wrong class, etc).public void setPrefix(java.lang.String prefix)
prefix
- The prefix to prepend to entries in the archive file.public java.lang.String getPrefix(Project p)
p
- the project to usepublic void setFullpath(java.lang.String fullpath)
fullpath
- the full pathname of the single entry in this fileset.public java.lang.String getFullpath(Project p)
p
- the project to usepublic void setEncoding(java.lang.String enc)
enc
- encoding as String.public java.lang.String getEncoding()
protected abstract ArchiveScanner newArchiveScanner()
public DirectoryScanner getDirectoryScanner(Project p)
getDirectoryScanner
in class AbstractFileSet
p
- the project to usepublic java.util.Iterator<Resource> iterator()
iterator
in interface java.lang.Iterable<Resource>
iterator
in interface ResourceCollection
iterator
in class FileSet
public int size()
size
in interface ResourceCollection
size
in class FileSet
public boolean isFilesystemOnly()
isFilesystemOnly
in interface ResourceCollection
isFilesystemOnly
in class FileSet
public void setFileMode(java.lang.String octalString)
octalString
- a String
valuepublic void integerSetFileMode(int mode)
We use the strange name so this method doesn't appear in IntrospectionHelpers list of attribute setters.
mode
- a int
valuepublic int getFileMode(Project p)
p
- the project to usepublic boolean hasFileModeBeenSet()
public void setDirMode(java.lang.String octalString)
octalString
- a String
valuepublic void integerSetDirMode(int mode)
We use the strange name so this method doesn't appear in IntrospectionHelpers list of attribute setters.
mode
- a int
valuepublic int getDirMode(Project p)
p
- the project to usepublic boolean hasDirModeBeenSet()
protected void configureFileSet(ArchiveFileSet zfs)
zfs
- the project to usepublic java.lang.Object clone()
public java.lang.String toString()
toString
in class AbstractFileSet
public java.lang.String getPrefix()
public java.lang.String getFullpath()
public int getFileMode()
public int getDirMode()
protected void dieOnCircularReference(java.util.Stack<java.lang.Object> stk, Project p) throws BuildException
DataType
If one is included, throw a BuildException created by circularReference
.
This implementation is appropriate only for a DataType that cannot hold other DataTypes as children.
The general contract of this method is that it shouldn't do
anything if DataType.checked
is true and
set it to true on exit.
dieOnCircularReference
in class AbstractFileSet
stk
- the stack of references to check.p
- the project to use to dereference the references.BuildException
- on error.