/** * @param p the current project * @return the directory attribute */ public File getDir(Project p) { if (isReference()) { return getRef(p).getDir(p); } return dir; }
private File manageFileList(FileList fl) throws IOException, InterruptedException { final File fromDir = fl.getDir(getProject()); final String[] srcFiles = fl.getFiles(getProject()); for (String src : srcFiles) { final File f = new File(fromDir, src); final boolean error = processingSingleFile(f); if (error) { return f; } } return null; }
/** * Return the list of files or directories from this FileList that * should be included on the command line. * @param list the FileList to check. * @return a String[] containing the directory names. * * @since Ant 1.6.2 */ protected String[] getFilesAndDirs(FileList list) { return restrict(list.getFiles(getProject()), list.getDir(getProject())); }
/** * Initializes this object with the given file set. * * @param project * @param fileList */ public void init(Project project, FileList fileList) { baseDir = fileList.getDir(project); files = fileList.getFiles(project); } }
private File manageFileList(FileList fl) throws IOException, InterruptedException { final File fromDir = fl.getDir(getProject()); final String[] srcFiles = fl.getFiles(getProject()); for (String src : srcFiles) { final File f = new File(fromDir, src); final boolean error = processingSingleFile(f); if (error) { return f; } } return null; }
/** * Returns the most recent modified timestamp of the file collection. * * Note: this must be combined into one method to account for both * Path and FileList erasure types. * * @param fileLists Collection of FileList or Path * @return Most recent modified timestamp */ private long getLastModifiedTime(List<?> fileLists) { long lastModified = 0; for (Object entry : fileLists) { if (entry instanceof FileList) { FileList list = (FileList) entry; for (String fileName : list.getFiles(this.getProject())) { File path = list.getDir(this.getProject()); File file = new File(path, fileName); lastModified = Math.max(getLastModifiedTime(file), lastModified); } } else if (entry instanceof Path) { Path path = (Path) entry; for (String src : path.list()) { File file = new File(src); lastModified = Math.max(getLastModifiedTime(file), lastModified); } } } return lastModified; }
/** * Returns the most recent modified timestamp of the file collection. * * Note: this must be combined into one method to account for both * Path and FileList erasure types. * * @param fileLists Collection of FileList or Path * @return Most recent modified timestamp */ private long getLastModifiedTime(List<?> fileLists) { long lastModified = 0; for (Object entry : fileLists) { if (entry instanceof FileList) { FileList list = (FileList) entry; for (String fileName : list.getFiles(this.getProject())) { File path = list.getDir(this.getProject()); File file = new File(path, fileName); lastModified = Math.max(getLastModifiedTime(file), lastModified); } } else if (entry instanceof Path) { Path path = (Path) entry; for (String src : path.list()) { File file = new File(src); lastModified = Math.max(getLastModifiedTime(file), lastModified); } } } return lastModified; }
for (FileList list : contributions) { Project project = list.getProject(); File dir = list.getDir(project); for (String file : list.getFiles(project)) { FileContributionSource source = createContributionSource(dir, file);
/** * Write an Ant file list * * @param fileList * @param id */ public void writeFileList( FileList fileList, String id ) { writer.startElement( "filelist" ); writer.addAttribute( "id", id ); File dir = fileList.getDir( fileList.getProject() ); writer.addAttribute( "dir", dir.getAbsolutePath() ); String[] files = fileList.getFiles( fileList.getProject() ); for ( int i = 0; i < files.length; ++i ) { writer.startElement( "file" ); writer.addAttribute( "name", files[i] ); writer.endElement(); } writer.endElement(); }
fileSet.setDir( fileList.getDir( getProject() ) );