Refine search
@Override public Map<String,String> invoke(File basedir, VirtualChannel channel) throws IOException, InterruptedException { Map<String,String> r = new HashMap<String,String>(); FileSet fileSet = Util.createFileSet(basedir, includes, excludes); fileSet.setDefaultexcludes(defaultExcludes); fileSet.setCaseSensitive(caseSensitive); for (String f : fileSet.getDirectoryScanner().getIncludedFiles()) { f = f.replace(File.separatorChar, '/'); r.put(f, f); } return r; } }
protected Collection getFiles() { Map fileMap = new HashMap(); Project p = getProject(); for (int i = 0; i < filesets.size(); i++) { FileSet fs = (FileSet)filesets.elementAt(i); DirectoryScanner ds = fs.getDirectoryScanner(p); String[] srcFiles = ds.getIncludedFiles(); File dir = fs.getDir(p); for (int j = 0; j < srcFiles.length; j++) { File src = new File(dir, srcFiles[j]); fileMap.put(src.getAbsolutePath(), src); } } return fileMap.values(); }
Set<String> parentSet = Stream.of(parentScanner.getIncludedFiles()) .collect(Collectors.toSet()); .filter(fName -> new File(basedir, fName).exists() && parentSet.contains(fName)) .forEach(fName -> included.addElement(fName));
final String tmpInclude = include.substring(pos + 1); if (tmpInclude.indexOf('*') >= 0 || tmpInclude.indexOf('?') >= 0 || (new File(include)).isFile()) { baseDir = new File(tmpBase); include = tmpInclude; } else { baseDir = new File(tmpBase, tmpInclude); include = "**/*"; for (String s : scanner.getIncludedFiles()) { final File f = new File(baseDir, s); LOGGER.debug("Found file {}", f.toString());
DirectoryScanner ds = fs.getDirectoryScanner(new Project()); if(ds.getIncludedFilesCount()!=0) { String[] names = ds.getIncludedFiles(); Arrays.sort(names,SHORTER_STRING_FIRST); for( String f : names) {
private void scan(String pattern) { LOGGER.fine("Scanning "+pattern+" for hs_err_pid files"); pattern = pattern.replace("%p","*").replace("%%","%"); File f = new File(pattern).getAbsoluteFile(); if (!pattern.contains("*")) scanFile(f); else {// GLOB File commonParent = f; while (commonParent!=null && commonParent.getPath().contains("*")) { commonParent = commonParent.getParentFile(); } if (commonParent==null) { LOGGER.warning("Failed to process "+f); return; // huh? } FileSet fs = Util.createFileSet(commonParent, f.getPath().substring(commonParent.getPath().length()+1), null); DirectoryScanner ds = fs.getDirectoryScanner(new Project()); for (String child : ds.getIncludedFiles()) { scanFile(new File(commonParent,child)); } } }
templateFile = new File(templateName); if (!templateFile.isAbsolute()) { templateFile = new File(getProject().getBaseDir(), templateName); if (new File(templateName).isAbsolute()) { throw new BuildException("Do not specify an absolute location for the template as well as a templateDir"); list = scanner.getIncludedFiles();
/** * Names of the classes to process. * @return the array of classes. * @since Ant 1.6.3 */ public String[] getClasses() { Stream<String> stream = Stream.concat( files.stream() .map(fs -> fs.getDirectoryScanner(getProject()).getIncludedFiles()) .flatMap(Stream::of) .map(s -> s.replace('\\', '.').replace('/', '.') .replaceFirst("\\.class$", "")), classes.stream().map(ClassArgument::getName)); if (cls != null) { stream = Stream.concat(Stream.of(cls.split(",")).map(String::trim), stream); } return stream.toArray(String[]::new); }
protected Collection getFiles() { Map fileMap = new HashMap(); Project p = getProject(); for (int i = 0; i < filesets.size(); i++) { FileSet fs = (FileSet)filesets.elementAt(i); DirectoryScanner ds = fs.getDirectoryScanner(p); String[] srcFiles = ds.getIncludedFiles(); File dir = fs.getDir(p); for (int j = 0; j < srcFiles.length; j++) { File src = new File(dir, srcFiles[j]); fileMap.put(src.getAbsolutePath(), src); } } return fileMap.values(); }
for (String name : ds.getIncludedFiles()) { File inc = new File(dir, name); File pf = inc.getParentFile(); Properties lnks = new Properties(); finalList.put(new File(pf, key).getAbsolutePath(), lnks.getProperty(key));
/** * Grabs all included files and directors from the FileSet and * returns them as an array of (relative) file names. * @param fs the fileset to operate on. * @return a list of the filenames. * @since Ant 1.7 */ protected static String[] getFileNames(final FileSet fs) { final DirectoryScanner ds = fs.getDirectoryScanner(fs.getProject()); final String[] directories = ds.getIncludedDirectories(); final String[] filesPerSe = ds.getIncludedFiles(); final String[] files = new String[directories.length + filesPerSe.length]; System.arraycopy(directories, 0, files, 0, directories.length); System.arraycopy(filesPerSe, 0, files, directories.length, filesPerSe.length); return files; }
private static void parseClassPath(Manifest manifest, File archive, List<File> paths, String attributeName, String separator) throws IOException { String classPath = manifest.getMainAttributes().getValue(attributeName); if(classPath==null) return; // attribute not found for (String s : classPath.split(separator)) { File file = resolve(archive, s); if(file.getName().contains("*")) { // handle wildcard FileSet fs = new FileSet(); File dir = file.getParentFile(); fs.setDir(dir); fs.setIncludes(file.getName()); for( String included : fs.getDirectoryScanner(new Project()).getIncludedFiles() ) { paths.add(new File(dir,included)); } } else { if(!file.exists()) throw new IOException("No such file: "+file); paths.add(file); } } }
ds.scan(); int patched = 0; for (final String f : ds.getIncludedFiles()) { patched += postProcess(new File(destDir, f), fixData);
/** * Runs Ant glob expansion. * * @return * A set of relative file names from the base directory. */ @Nonnull private static String[] glob(File dir, String includes, String excludes, boolean defaultExcludes) throws IOException { if(isAbsolute(includes)) throw new IOException("Expecting Ant GLOB pattern, but saw '"+includes+"'. See http://ant.apache.org/manual/Types/fileset.html for syntax"); FileSet fs = Util.createFileSet(dir,includes,excludes); fs.setDefaultexcludes(defaultExcludes); DirectoryScanner ds; try { ds = fs.getDirectoryScanner(new Project()); } catch (BuildException x) { throw new IOException(x.getMessage()); } String[] files = ds.getIncludedFiles(); return files; }
protected Collection getFiles() { Map fileMap = new HashMap(); Project p = getProject(); for (int i = 0; i < filesets.size(); i++) { FileSet fs = (FileSet)filesets.elementAt(i); DirectoryScanner ds = fs.getDirectoryScanner(p); String[] srcFiles = ds.getIncludedFiles(); File dir = fs.getDir(p); for (int j = 0; j < srcFiles.length; j++) { File src = new File(dir, srcFiles[j]); fileMap.put(src.getAbsolutePath(), src); } } return fileMap.values(); }
args[j++] = compileClasspath.toString(); this.scanDir(ds.getIncludedFiles()); log("Compiling " + filesToDo.size() + " JSP files"); File jspFile = new File(filename); args[j] = "-package"; String parents = jspFile.getParent();
filesets[i].getDirectoryScanner(getProject()); if (rs instanceof ZipScanner) { ((ZipScanner) rs).setEncoding(encoding); for (String f : rs.getIncludedFiles()) { if (!f.isEmpty() || !skipEmptyNames) { resources.add(rs.getResource(f));
private String[] collectFiles() { List<String> files = new ArrayList<String>(); for ( Object fileSet : fileSets ) { final FileSet fs = (FileSet) fileSet; final DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); for ( String dsFile : ds.getIncludedFiles() ) { File f = new File( dsFile ); if ( !f.isFile() ) { f = new File( ds.getBasedir(), dsFile ); } files.add( f.getAbsolutePath() ); } } return ArrayHelper.toStringArray( files ); }
String[] includes = scanner.getIncludedFiles(); log.debug(" " + includes[j]); File file = new File(basedir, includes[j]); cu.addSource(file);
fs.getDirectoryScanner(getProject()).getIncludedFiles())) { upToDate = false; break;