FileDocCategorySizeDatePackage
FileSet.javaAPI DocApache Ant 1.702710Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.types

FileSet

public class FileSet extends AbstractFileSet implements ResourceCollection
Moved out of MatchingTask to make it a standalone object that could be referenced (by scripts for example).

Fields Summary
Constructors Summary
public FileSet()
Constructor for FileSet.

        super();
    
protected FileSet(FileSet fileset)
Constructor for FileSet, with FileSet to shallowly clone.

param
fileset the fileset to clone

        super(fileset);
    
Methods Summary
public java.lang.Objectclone()
Return a FileSet that has the same basedir and same patternsets as this one.

return
the cloned fileset

        if (isReference()) {
            return ((FileSet) getRef(getProject())).clone();
        } else {
            return super.clone();
        }
    
public booleanisFilesystemOnly()
Always returns true.

return
true indicating that all elements will be FileResources.
since
Ant 1.7

        return true;
    
public java.util.Iteratoriterator()
Fulfill the ResourceCollection contract.

return
an Iterator of Resources.
since
Ant 1.7

        if (isReference()) {
            return ((FileSet) getRef(getProject())).iterator();
        }
        return new FileResourceIterator(getDir(getProject()),
            getDirectoryScanner(getProject()).getIncludedFiles());
    
public intsize()
Fulfill the ResourceCollection contract.

return
number of elements as int.
since
Ant 1.7

        if (isReference()) {
            return ((FileSet) getRef(getProject())).size();
        }
        return getDirectoryScanner(getProject()).getIncludedFilesCount();