1 18 19 package org.apache.tools.ant.types; 20 21 import java.util.Iterator ; 22 23 import org.apache.tools.ant.types.resources.FileResourceIterator; 24 25 30 public class FileSet extends AbstractFileSet implements ResourceCollection { 31 32 35 public FileSet() { 36 super(); 37 } 38 39 43 protected FileSet(FileSet fileset) { 44 super(fileset); 45 } 46 47 52 public Object clone() { 53 if (isReference()) { 54 return ((FileSet) getRef(getProject())).clone(); 55 } else { 56 return super.clone(); 57 } 58 } 59 60 65 public Iterator iterator() { 66 if (isReference()) { 67 return ((FileSet) getRef(getProject())).iterator(); 68 } 69 return new FileResourceIterator(getDir(getProject()), 70 getDirectoryScanner(getProject()).getIncludedFiles()); 71 } 72 73 78 public int size() { 79 if (isReference()) { 80 return ((FileSet) getRef(getProject())).size(); 81 } 82 return getDirectoryScanner(getProject()).getIncludedFilesCount(); 83 } 84 85 90 public boolean isFilesystemOnly() { 91 return true; 92 } 93 94 } 95 | Popular Tags |