Methods Summary |
---|
public synchronized void | appendExcludes(java.lang.String[] excludes)Append excludes to the current list of include
patterns.
checkAttributesAllowed();
if (excludes != null) {
for (int i = 0; i < excludes.length; i++) {
defaultPatterns.createExclude().setName(excludes[i]);
}
ds = null;
}
|
public synchronized void | appendIncludes(java.lang.String[] includes)Append includes to the current list of include
patterns.
checkAttributesAllowed();
if (includes != null) {
for (int i = 0; i < includes.length; i++) {
defaultPatterns.createInclude().setName(includes[i]);
}
ds = null;
}
|
public synchronized void | appendSelector(org.apache.tools.ant.types.selectors.FileSelector selector)Add a new selector into this container.
if (isReference()) {
throw noChildrenAllowed();
}
super.appendSelector(selector);
ds = null;
|
public synchronized java.lang.Object | clone()Create 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().clone();
}
try {
Files f = (Files) super.clone();
f.defaultPatterns = (PatternSet) defaultPatterns.clone();
f.additionalPatterns = new Vector(additionalPatterns.size());
for (Iterator iter = additionalPatterns.iterator(); iter.hasNext();) {
PatternSet ps = (PatternSet) iter.next();
f.additionalPatterns.add(ps.clone());
}
f.selectors = new Vector(selectors);
return f;
} catch (CloneNotSupportedException e) {
throw new BuildException(e);
}
|
public synchronized PatternSet.NameEntry | createExclude()Add a name entry to the exclude list.
if (isReference()) {
throw noChildrenAllowed();
}
ds = null;
return defaultPatterns.createExclude();
|
public synchronized PatternSet.NameEntry | createExcludesFile()Add a name entry to the excludes files list.
if (isReference()) {
throw noChildrenAllowed();
}
ds = null;
return defaultPatterns.createExcludesFile();
|
public synchronized PatternSet.NameEntry | createInclude()Add a name entry to the include list.
if (isReference()) {
throw noChildrenAllowed();
}
ds = null;
return defaultPatterns.createInclude();
|
public synchronized PatternSet.NameEntry | createIncludesFile()Add a name entry to the include files list.
if (isReference()) {
throw noChildrenAllowed();
}
ds = null;
return defaultPatterns.createIncludesFile();
|
public synchronized org.apache.tools.ant.types.PatternSet | createPatternSet()Create a nested patternset.
if (isReference()) {
throw noChildrenAllowed();
}
PatternSet patterns = new PatternSet();
additionalPatterns.addElement(patterns);
ds = null;
return patterns;
|
private synchronized void | ensureDirectoryScannerSetup()
if (ds == null) {
ds = new DirectoryScanner();
PatternSet ps = mergePatterns(getProject());
ds.setIncludes(ps.getIncludePatterns(getProject()));
ds.setExcludes(ps.getExcludePatterns(getProject()));
ds.setSelectors(getSelectors(getProject()));
if (useDefaultExcludes) {
ds.addDefaultExcludes();
}
ds.setCaseSensitive(caseSensitive);
ds.setFollowSymlinks(followSymlinks);
}
|
public synchronized boolean | getDefaultexcludes()Get whether default exclusions should be used or not.
return (isReference())
? getRef().getDefaultexcludes() : useDefaultExcludes;
|
protected org.apache.tools.ant.types.resources.Files | getRef()Perform the check for circular references and return the
referenced Files collection.
return (Files) getCheckedRef();
|
public synchronized boolean | hasPatterns()Find out whether this Files collection has patterns.
if (isReference()) {
return getRef().hasPatterns();
}
if (hasPatterns(defaultPatterns)) {
return true;
}
for (Iterator i = additionalPatterns.iterator(); i.hasNext();) {
if (hasPatterns((PatternSet) i.next())) {
return true;
}
}
return false;
|
private boolean | hasPatterns(org.apache.tools.ant.types.PatternSet ps)
return ps.getIncludePatterns(getProject()).length > 0
|| ps.getExcludePatterns(getProject()).length > 0;
|
public synchronized boolean | isCaseSensitive()Find out if this Files collection is case-sensitive.
return (isReference())
? getRef().isCaseSensitive() : caseSensitive;
|
public boolean | isFilesystemOnly()Always returns true.
return true;
|
public synchronized boolean | isFollowSymlinks()Find out whether symbolic links should be followed.
return (isReference())
? getRef().isFollowSymlinks() : followSymlinks;
|
public synchronized java.util.Iterator | iterator()Fulfill the ResourceCollection contract.
if (isReference()) {
return getRef().iterator();
}
ensureDirectoryScannerSetup();
ds.scan();
int fct = ds.getIncludedFilesCount();
int dct = ds.getIncludedDirsCount();
if (fct + dct == 0) {
return EMPTY_ITERATOR;
}
FileResourceIterator result = new FileResourceIterator();
if (fct > 0) {
result.addFiles(ds.getIncludedFiles());
}
if (dct > 0) {
result.addFiles(ds.getIncludedDirectories());
}
return result;
|
public java.lang.String[] | mergeExcludes(org.apache.tools.ant.Project p)Get the merged exclude patterns for this Files collection.
return mergePatterns(p).getExcludePatterns(p);
|
public java.lang.String[] | mergeIncludes(org.apache.tools.ant.Project p)Get the merged include patterns for this Files collection.
return mergePatterns(p).getIncludePatterns(p);
|
public synchronized org.apache.tools.ant.types.PatternSet | mergePatterns(org.apache.tools.ant.Project p)Get the merged patterns for this Files collection.
if (isReference()) {
return getRef().mergePatterns(p);
}
PatternSet ps = new PatternSet();
ps.append(defaultPatterns, p);
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 void | setCaseSensitive(boolean caseSensitive)Set case-sensitivity of the Files collection.
checkAttributesAllowed();
this.caseSensitive = caseSensitive;
ds = null;
|
public synchronized void | setDefaultexcludes(boolean useDefaultExcludes)Set whether default exclusions should be used or not.
checkAttributesAllowed();
this.useDefaultExcludes = useDefaultExcludes;
ds = null;
|
public synchronized void | setExcludes(java.lang.String excludes)Append excludes to the current list of exclude
patterns.
Patterns may be separated by a comma or a space.
checkAttributesAllowed();
defaultPatterns.setExcludes(excludes);
ds = null;
|
public synchronized void | setExcludesfile(java.io.File excl)Set the File containing the excludes patterns.
checkAttributesAllowed();
defaultPatterns.setExcludesfile(excl);
ds = null;
|
public synchronized void | setFollowSymlinks(boolean followSymlinks)Set whether or not symbolic links should be followed.
checkAttributesAllowed();
this.followSymlinks = followSymlinks;
ds = null;
|
public synchronized void | setIncludes(java.lang.String includes)Append includes to the current list of include
patterns.
Patterns may be separated by a comma or a space.
checkAttributesAllowed();
defaultPatterns.setIncludes(includes);
ds = null;
|
public synchronized void | setIncludesfile(java.io.File incl)Set the File containing the includes patterns.
checkAttributesAllowed();
defaultPatterns.setIncludesfile(incl);
ds = null;
|
public void | setRefid(org.apache.tools.ant.types.Reference r)Make 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 (hasPatterns(defaultPatterns)) {
throw tooManyAttributes();
}
if (!additionalPatterns.isEmpty()) {
throw noChildrenAllowed();
}
if (!selectors.isEmpty()) {
throw noChildrenAllowed();
}
super.setRefid(r);
|
public synchronized int | size()Fulfill the ResourceCollection contract.
if (isReference()) {
return getRef().size();
}
ensureDirectoryScannerSetup();
ds.scan();
return ds.getIncludedFilesCount() + ds.getIncludedDirsCount();
|
public java.lang.String | toString()Format this Files collection as a String.
if (isReference()) {
return getRef().toString();
}
Iterator i = iterator();
if (!i.hasNext()) {
return "";
}
StringBuffer sb = new StringBuffer();
while (i.hasNext()) {
if (sb.length() > 0) {
sb.append(File.pathSeparatorChar);
}
sb.append(i.next());
}
return sb.toString();
|