Methods Summary |
---|
public void | addConfigured(ResourceCollection a)Set the source Archive file for the archivefileset. Prevents both
"dir" and "src" from being specified.
checkChildrenAllowed();
if (a.size() != 1) {
throw new BuildException("only single argument resource collections"
+ " are supported as archives");
}
setSrcResource((Resource) a.iterator().next());
|
private void | checkArchiveAttributesAllowed()A check attributes for archiveFileSet.
If there is a reference, and
it is a ArchiveFileSet, the archive fileset attributes
cannot be used.
(Note, we can only see if the reference is an archive
fileset if the project has been set).
if (getProject() == null
|| (isReference()
&& (getRefid().getReferencedObject(
getProject())
instanceof ArchiveFileSet))) {
checkAttributesAllowed();
}
|
public java.lang.Object | clone()Return a ArchiveFileSet that has the same properties
as this one.
if (isReference()) {
return ((ArchiveFileSet) getRef(getProject())).clone();
} else {
return super.clone();
}
|
protected void | configureFileSet(org.apache.tools.ant.types.ArchiveFileSet zfs)A ArchiveFileset accepts another ArchiveFileSet or a FileSet as reference
FileSets are often used by the war task for the lib attribute
zfs.setPrefix(prefix);
zfs.setFullpath(fullpath);
zfs.fileModeHasBeenSet = fileModeHasBeenSet;
zfs.fileMode = fileMode;
zfs.dirModeHasBeenSet = dirModeHasBeenSet;
zfs.dirMode = dirMode;
|
public int | getDirMode(org.apache.tools.ant.Project p)Get the dir mode of the archive fileset
if (isReference()) {
return ((ArchiveFileSet) getRef(p)).getDirMode(p);
}
return dirMode;
|
public int | getDirMode()
return dirMode;
|
public org.apache.tools.ant.DirectoryScanner | getDirectoryScanner(org.apache.tools.ant.Project p)Return the DirectoryScanner associated with this FileSet.
If the ArchiveFileSet defines a source Archive file, then a ArchiveScanner
is returned instead.
if (isReference()) {
return getRef(p).getDirectoryScanner(p);
}
if (src == null) {
return super.getDirectoryScanner(p);
}
if (!src.isExists()) {
throw new BuildException("the archive doesn't exist");
}
if (src.isDirectory()) {
throw new BuildException("the archive can't be a directory");
}
ArchiveScanner as = newArchiveScanner();
as.setSrc(src);
super.setDir(p.getBaseDir());
setupDirectoryScanner(as, p);
as.init();
return as;
|
public int | getFileMode(org.apache.tools.ant.Project p)Get the mode of the archive fileset
if (isReference()) {
return ((ArchiveFileSet) getRef(p)).getFileMode(p);
}
return fileMode;
|
public int | getFileMode()
return fileMode;
|
public java.lang.String | getFullpath(org.apache.tools.ant.Project p)Return the full pathname of the single entry in this fileset.
if (isReference()) {
return ((ArchiveFileSet) getRef(p)).getFullpath(p);
}
return fullpath;
|
public java.lang.String | getFullpath()Return the full pathname of the single entryZ in this fileset.
return fullpath;
|
public java.lang.String | getPrefix(org.apache.tools.ant.Project p)Return the prefix prepended to entries in the archive file.
if (isReference()) {
return ((ArchiveFileSet) getRef(p)).getPrefix(p);
}
return prefix;
|
public java.lang.String | getPrefix()Return the prefix prepended to entries in the archive file.
return prefix;
|
public java.io.File | getSrc(org.apache.tools.ant.Project p)Get the archive from which entries will be extracted.
if (isReference()) {
return ((ArchiveFileSet) getRef(p)).getSrc(p);
}
return getSrc();
|
public java.io.File | getSrc()Get the archive file from which entries will be extracted.
if (src instanceof FileResource) {
return ((FileResource) src).getFile();
}
return null;
|
public boolean | hasDirModeBeenSet()Whether the user has specified the mode explicitly.
if (isReference()) {
return ((ArchiveFileSet) getRef(getProject())).hasDirModeBeenSet();
}
return dirModeHasBeenSet;
|
public boolean | hasFileModeBeenSet()Whether the user has specified the mode explicitly.
if (isReference()) {
return ((ArchiveFileSet) getRef(getProject())).hasFileModeBeenSet();
}
return fileModeHasBeenSet;
|
public void | integerSetDirMode(int mode)specify the user, group and
other modes in the standard Unix fashion;
optional, default=0755
We use the strange name so this method doesn't appear in
IntrospectionHelpers list of attribute setters.
dirModeHasBeenSet = true;
this.dirMode = UnixStat.DIR_FLAG | mode;
|
public void | integerSetFileMode(int mode)specify the user, group and
other modes in the standard Unix fashion;
optional, default=0644
We use the strange name so this method doesn't appear in
IntrospectionHelpers list of attribute setters.
fileModeHasBeenSet = true;
this.fileMode = UnixStat.FILE_FLAG | mode;
|
public boolean | isFilesystemOnly()Indicate whether this ResourceCollection is composed entirely of
Resources accessible via local filesystem conventions. If true,
all Resources returned from this ResourceCollection should be
instances of FileResource.
return src == null;
|
public java.util.Iterator | iterator()Fulfill the ResourceCollection contract.
if (isReference()) {
return ((ResourceCollection) (getRef(getProject()))).iterator();
}
if (src == null) {
return super.iterator();
}
ArchiveScanner as = (ArchiveScanner) getDirectoryScanner(getProject());
return as.getResourceFiles();
|
protected abstract ArchiveScanner | newArchiveScanner()Creates a scanner for this type of archive.
|
public void | setDir(java.io.File dir)Set the directory for the fileset.
checkAttributesAllowed();
if (src != null) {
throw new BuildException("Cannot set both dir and src attributes");
} else {
super.setDir(dir);
hasDir = true;
}
|
public 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
checkArchiveAttributesAllowed();
integerSetDirMode(Integer.parseInt(octalString, BASE_OCTAL));
|
public 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
checkArchiveAttributesAllowed();
integerSetFileMode(Integer.parseInt(octalString, BASE_OCTAL));
|
public void | setFullpath(java.lang.String fullpath)Set the full pathname of the single entry in this fileset.
Prevents both prefix and fullpath from being specified
checkArchiveAttributesAllowed();
if (!prefix.equals("") && !fullpath.equals("")) {
throw new BuildException("Cannot set both fullpath and prefix attributes");
}
this.fullpath = fullpath;
|
public void | setPrefix(java.lang.String prefix)Prepend this prefix to the path for each archive entry.
Prevents both prefix and fullpath from being specified
checkArchiveAttributesAllowed();
if (!prefix.equals("") && !fullpath.equals("")) {
throw new BuildException("Cannot set both fullpath and prefix attributes");
}
this.prefix = prefix;
|
public void | setSrc(java.io.File srcFile)Set the source Archive file for the archivefileset. Prevents both
"dir" and "src" from being specified.
setSrcResource(new FileResource(srcFile));
|
public void | setSrcResource(Resource src)Set the source Archive file for the archivefileset. Prevents both
"dir" and "src" from being specified.
checkArchiveAttributesAllowed();
if (hasDir) {
throw new BuildException("Cannot set both dir and src attributes");
}
this.src = src;
|
public int | size()Fulfill the ResourceCollection contract.
if (isReference()) {
return ((ResourceCollection) (getRef(getProject()))).size();
}
if (src == null) {
return super.size();
}
ArchiveScanner as = (ArchiveScanner) getDirectoryScanner(getProject());
return as.getIncludedFilesCount();
|
public java.lang.String | toString()for file based zipfilesets, return the same as for normal filesets
else just return the path of the zip
if (hasDir && getProject() != null) {
return super.toString();
} else if (src != null) {
return src.getName();
} else {
return null;
}
|