1 62 package org.codehaus.groovy.ant; 63 64 import java.util.ArrayList ; 65 import java.util.Iterator ; 66 import java.util.List ; 67 68 import org.apache.tools.ant.Project; 69 import org.apache.tools.ant.types.FileSet; 70 71 78 public class FileScanner { 79 80 81 private List filesets = new ArrayList (); 82 83 84 private Project project; 85 86 public FileScanner() { 87 } 88 89 public FileScanner(Project project) { 90 this.project = project; 91 } 92 93 public void setProject(Project project) { 94 this.project = project; 95 } 96 97 public Iterator iterator() { 98 return new FileIterator(project, filesets.iterator()); 99 } 100 101 public Iterator directories() { 102 return new FileIterator(project, filesets.iterator(), true); 103 } 104 105 public boolean hasFiles() { 106 return filesets.size() > 0; 107 } 108 109 112 public void clear() { 113 filesets.clear(); 114 } 115 116 119 122 public void addFileset(FileSet set) { 123 filesets.add(set); 124 } 125 126 } 127 | Popular Tags |