/** * Returns the list of files represented by this FileList. * @param p the current project * @return the list of files represented by this FileList. */ public String[] getFiles(Project p) { if (isReference()) { return getRef(p).getFiles(p); } if (dir == null) { throw new BuildException("No directory specified for filelist."); } if (filenames.isEmpty()) { throw new BuildException("No files specified for filelist."); } return filenames.toArray(new String[filenames.size()]); }
/** * @param p the current project * @return the directory attribute */ public File getDir(Project p) { if (isReference()) { return getRef(p).getDir(p); } return dir; }
/** * Fulfill the ResourceCollection contract. * @return number of elements as int. * @since Ant 1.7 */ @Override public int size() { if (isReference()) { return getRef(getProject()).size(); } return filenames.size(); }
/** * Fulfill the ResourceCollection contract. * @return an Iterator of Resources. * @since Ant 1.7 */ @Override public Iterator<Resource> iterator() { if (isReference()) { return getRef(getProject()).iterator(); } return new FileResourceIterator(getProject(), dir, filenames.toArray(new String[filenames.size()])); }