Methods Summary |
---|
public void | add(org.apache.tools.ant.types.selectors.FileSelector selector)Add an arbitary selector.
appendSelector(selector);
|
public void | addAnd(org.apache.tools.ant.types.selectors.AndSelector selector)Add an "And" selector entry on the selector list.
appendSelector(selector);
|
public void | addContains(org.apache.tools.ant.types.selectors.ContainsSelector selector)Add a contains selector entry on the selector list.
appendSelector(selector);
|
public void | addContainsRegexp(org.apache.tools.ant.types.selectors.ContainsRegexpSelector selector)Add a regular expression selector entry on the selector list.
appendSelector(selector);
|
public void | addCustom(org.apache.tools.ant.types.selectors.ExtendSelector selector)Add an extended selector entry on the selector list.
appendSelector(selector);
|
public void | addDate(org.apache.tools.ant.types.selectors.DateSelector selector)Add a selector date entry on the selector list.
appendSelector(selector);
|
public void | addDepend(org.apache.tools.ant.types.selectors.DependSelector selector)Add a depends selector entry on the selector list.
appendSelector(selector);
|
public void | addDepth(org.apache.tools.ant.types.selectors.DepthSelector selector)Add a depth selector entry on the selector list.
appendSelector(selector);
|
public void | addDifferent(org.apache.tools.ant.types.selectors.DifferentSelector selector)Add a DifferentSelector entry on the selector list.
appendSelector(selector);
|
public void | addFilename(org.apache.tools.ant.types.selectors.FilenameSelector selector)Add a selector filename entry on the selector list.
appendSelector(selector);
|
public void | addMajority(org.apache.tools.ant.types.selectors.MajoritySelector selector)Add a majority selector entry on the selector list.
appendSelector(selector);
|
public void | addModified(org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector selector)Add the modified selector.
appendSelector(selector);
|
public void | addNone(org.apache.tools.ant.types.selectors.NoneSelector selector)Add a "None" selector entry on the selector list.
appendSelector(selector);
|
public void | addNot(org.apache.tools.ant.types.selectors.NotSelector selector)Add a "Not" selector entry on the selector list.
appendSelector(selector);
|
public void | addOr(org.apache.tools.ant.types.selectors.OrSelector selector)Add an "Or" selector entry on the selector list.
appendSelector(selector);
|
public void | addPresent(org.apache.tools.ant.types.selectors.PresentSelector selector)Add a present selector entry on the selector list.
appendSelector(selector);
|
public void | addSelector(org.apache.tools.ant.types.selectors.SelectSelector selector)Add a "Select" selector entry on the selector list.
appendSelector(selector);
|
public void | addSize(org.apache.tools.ant.types.selectors.SizeSelector selector)Add a selector size entry on the selector list.
appendSelector(selector);
|
public void | addType(org.apache.tools.ant.types.selectors.TypeSelector selector)Add a selector type entry on the selector list.
appendSelector(selector);
|
public synchronized void | appendExcludes(java.lang.String[] excludes)Appends excludes to the current list of include
patterns.
if (isReference()) {
throw tooManyAttributes();
}
if (excludes != null) {
for (int i = 0; i < excludes.length; i++) {
defaultPatterns.createExclude().setName(excludes[i]);
}
directoryScanner = null;
}
|
public synchronized void | appendIncludes(java.lang.String[] includes)Appends includes to the current list of include
patterns.
if (isReference()) {
throw tooManyAttributes();
}
if (includes != null) {
for (int i = 0; i < includes.length; i++) {
defaultPatterns.createInclude().setName(includes[i]);
}
directoryScanner = null;
}
|
public synchronized void | appendSelector(org.apache.tools.ant.types.selectors.FileSelector selector)Add a new selector into this container.
if (isReference()) {
throw noChildrenAllowed();
}
selectors.addElement(selector);
directoryScanner = null;
|
public synchronized java.lang.Object | clone()Creates a deep clone of this instance, except for the nested
selectors (the list of selectors is a shallow clone of this
instance's list).
if (isReference()) {
return (getRef(getProject())).clone();
} else {
try {
AbstractFileSet fs = (AbstractFileSet) super.clone();
fs.defaultPatterns = (PatternSet) defaultPatterns.clone();
fs.additionalPatterns = new Vector(additionalPatterns.size());
Enumeration e = additionalPatterns.elements();
while (e.hasMoreElements()) {
fs.additionalPatterns
.addElement(((PatternSet) e.nextElement()).clone());
}
fs.selectors = new Vector(selectors);
return fs;
} catch (CloneNotSupportedException e) {
throw new BuildException(e);
}
}
|
public synchronized PatternSet.NameEntry | createExclude()Add a name entry to the exclude list.
if (isReference()) {
throw noChildrenAllowed();
}
directoryScanner = null;
return defaultPatterns.createExclude();
|
public synchronized PatternSet.NameEntry | createExcludesFile()Add a name entry to the excludes files list.
if (isReference()) {
throw noChildrenAllowed();
}
directoryScanner = null;
return defaultPatterns.createExcludesFile();
|
public synchronized PatternSet.NameEntry | createInclude()Add a name entry to the include list.
if (isReference()) {
throw noChildrenAllowed();
}
directoryScanner = null;
return defaultPatterns.createInclude();
|
public synchronized PatternSet.NameEntry | createIncludesFile()Add a name entry to the include files list.
if (isReference()) {
throw noChildrenAllowed();
}
directoryScanner = null;
return defaultPatterns.createIncludesFile();
|
public synchronized PatternSet | createPatternSet()Creates a nested patternset.
if (isReference()) {
throw noChildrenAllowed();
}
PatternSet patterns = new PatternSet();
additionalPatterns.addElement(patterns);
directoryScanner = null;
return patterns;
|
public synchronized boolean | getDefaultexcludes()Whether default exclusions should be used or not.
return (isReference())
? getRef(getProject()).getDefaultexcludes() : useDefaultExcludes;
|
public java.io.File | getDir()Retrieves the base-directory for this instance.
return getDir(getProject());
|
public synchronized java.io.File | getDir(org.apache.tools.ant.Project p)Retrieves the base-directory for this instance.
return (isReference()) ? getRef(p).getDir(p) : dir;
|
public org.apache.tools.ant.DirectoryScanner | getDirectoryScanner()Returns the directory scanner needed to access the files to process.
return getDirectoryScanner(getProject());
|
public org.apache.tools.ant.DirectoryScanner | getDirectoryScanner(org.apache.tools.ant.Project p)Returns the directory scanner needed to access the files to process.
if (isReference()) {
return getRef(p).getDirectoryScanner(p);
}
DirectoryScanner ds = null;
synchronized (this) {
if (directoryScanner != null && p == getProject()) {
ds = directoryScanner;
} else {
if (dir == null) {
throw new BuildException("No directory specified for "
+ getDataTypeName() + ".");
}
if (!dir.exists()) {
throw new BuildException(dir.getAbsolutePath()
+ " not found.");
}
if (!dir.isDirectory()) {
throw new BuildException(dir.getAbsolutePath()
+ " is not a directory.");
}
ds = new DirectoryScanner();
setupDirectoryScanner(ds, p);
ds.setFollowSymlinks(followSymlinks);
directoryScanner = (p == getProject()) ? ds : directoryScanner;
}
}
ds.scan();
return ds;
|
protected org.apache.tools.ant.types.AbstractFileSet | getRef(org.apache.tools.ant.Project p)Performs the check for circular references and returns the
referenced FileSet.
return (AbstractFileSet) getCheckedRef(p);
|
public synchronized org.apache.tools.ant.types.selectors.FileSelector[] | getSelectors(org.apache.tools.ant.Project p)Returns the set of selectors as an array.
return (isReference())
? getRef(p).getSelectors(p) : (FileSelector[]) (selectors.toArray(
new FileSelector[selectors.size()]));
|
public synchronized boolean | hasPatterns()Indicates whether there are any patterns here.
if (isReference() && getProject() != null) {
return getRef(getProject()).hasPatterns();
}
if (defaultPatterns.hasPatterns(getProject())) {
return true;
}
Enumeration e = additionalPatterns.elements();
while (e.hasMoreElements()) {
PatternSet ps = (PatternSet) e.nextElement();
if (ps.hasPatterns(getProject())) {
return true;
}
}
return false;
|
public synchronized boolean | hasSelectors()Indicates whether there are any selectors here.
return (isReference() && getProject() != null)
? getRef(getProject()).hasSelectors() : !(selectors.isEmpty());
|
public synchronized boolean | isCaseSensitive()Find out if the fileset is case sensitive.
return (isReference())
? getRef(getProject()).isCaseSensitive() : caseSensitive;
|
public synchronized boolean | isFollowSymlinks()Find out if the fileset wants to follow symbolic links.
return (isReference())
? getRef(getProject()).isFollowSymlinks() : followSymlinks;
|
public java.lang.String[] | mergeExcludes(org.apache.tools.ant.Project p)Get the merged exclude patterns for this AbstractFileSet.
return mergePatterns(p).getExcludePatterns(p);
|
public java.lang.String[] | mergeIncludes(org.apache.tools.ant.Project p)Get the merged include patterns for this AbstractFileSet.
return mergePatterns(p).getIncludePatterns(p);
|
public synchronized PatternSet | mergePatterns(org.apache.tools.ant.Project p)Get the merged patterns for this AbstractFileSet.
if (isReference()) {
return getRef(p).mergePatterns(p);
}
PatternSet ps = (PatternSet) defaultPatterns.clone();
final int count = additionalPatterns.size();
for (int i = 0; i < count; i++) {
Object o = additionalPatterns.elementAt(i);
ps.append((PatternSet) o, p);
}
return ps;
|
public synchronized int | selectorCount()Gives the count of the number of selectors in this container.
return (isReference() && getProject() != null)
? getRef(getProject()).selectorCount() : selectors.size();
|
public synchronized java.util.Enumeration | selectorElements()Returns an enumerator for accessing the set of selectors.
return (isReference() && getProject() != null)
? getRef(getProject()).selectorElements() : selectors.elements();
|
public synchronized void | setCaseSensitive(boolean caseSensitive)Sets case sensitivity of the file system.
if (isReference()) {
throw tooManyAttributes();
}
this.caseSensitive = caseSensitive;
directoryScanner = null;
|
public synchronized void | setDefaultexcludes(boolean useDefaultExcludes)Sets whether default exclusions should be used or not.
if (isReference()) {
throw tooManyAttributes();
}
this.useDefaultExcludes = useDefaultExcludes;
directoryScanner = null;
|
public synchronized void | setDir(java.io.File dir)Sets the base-directory for this instance.
if (isReference()) {
throw tooManyAttributes();
}
this.dir = dir;
directoryScanner = null;
|
public synchronized void | setExcludes(java.lang.String excludes)Appends excludes to the current list of exclude
patterns.
Patterns may be separated by a comma or a space.
if (isReference()) {
throw tooManyAttributes();
}
defaultPatterns.setExcludes(excludes);
directoryScanner = null;
|
public synchronized void | setExcludesfile(java.io.File excl)Sets the File containing the excludes patterns.
if (isReference()) {
throw tooManyAttributes();
}
defaultPatterns.setExcludesfile(excl);
directoryScanner = null;
|
public synchronized void | setFile(java.io.File file)Creates a single file fileset.
if (isReference()) {
throw tooManyAttributes();
}
setDir(file.getParentFile());
createInclude().setName(file.getName());
|
public synchronized void | setFollowSymlinks(boolean followSymlinks)Sets whether or not symbolic links should be followed.
if (isReference()) {
throw tooManyAttributes();
}
this.followSymlinks = followSymlinks;
directoryScanner = null;
|
public synchronized void | setIncludes(java.lang.String includes)Appends includes to the current list of include
patterns.
Patterns may be separated by a comma or a space.
if (isReference()) {
throw tooManyAttributes();
}
defaultPatterns.setIncludes(includes);
directoryScanner = null;
|
public synchronized void | setIncludesfile(java.io.File incl)Sets the File containing the includes patterns.
if (isReference()) {
throw tooManyAttributes();
}
defaultPatterns.setIncludesfile(incl);
directoryScanner = null;
|
public void | setRefid(Reference r)Makes this instance in effect a reference to another instance.
You must not set another attribute or nest elements inside
this element if you make it a reference.
if (dir != null || defaultPatterns.hasPatterns(getProject())) {
throw tooManyAttributes();
}
if (!additionalPatterns.isEmpty()) {
throw noChildrenAllowed();
}
if (!selectors.isEmpty()) {
throw noChildrenAllowed();
}
super.setRefid(r);
|
public void | setupDirectoryScanner(org.apache.tools.ant.FileScanner ds)Set up the specified directory scanner against this
AbstractFileSet's Project.
setupDirectoryScanner(ds, getProject());
|
public synchronized void | setupDirectoryScanner(org.apache.tools.ant.FileScanner ds, org.apache.tools.ant.Project p)Set up the specified directory scanner against the specified project.
if (isReference()) {
getRef(p).setupDirectoryScanner(ds, p);
return;
}
if (ds == null) {
throw new IllegalArgumentException("ds cannot be null");
}
ds.setBasedir(dir);
PatternSet ps = mergePatterns(p);
p.log(getDataTypeName() + ": Setup scanner in dir " + dir
+ " with " + ps, Project.MSG_DEBUG);
ds.setIncludes(ps.getIncludePatterns(p));
ds.setExcludes(ps.getExcludePatterns(p));
if (ds instanceof SelectorScanner) {
SelectorScanner ss = (SelectorScanner) ds;
ss.setSelectors(getSelectors(p));
}
if (useDefaultExcludes) {
ds.addDefaultExcludes();
}
ds.setCaseSensitive(caseSensitive);
|
public java.lang.String | toString()Returns included files as a list of semicolon-separated filenames.
DirectoryScanner ds = getDirectoryScanner(getProject());
String[] files = ds.getIncludedFiles();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < files.length; i++) {
if (i > 0) {
sb.append(';");
}
sb.append(files[i]);
}
return sb.toString();
|