/** * Returns true (the file is selected) only if all other selectors * agree that the file should be selected. * * @param basedir the base directory the scan is being done from * @param filename the name of the file to check * @param file a java.io.File object for the filename that the selector * can use * @return whether the file should be selected or not */ public boolean isSelected(File basedir, String filename, File file) { validate(); return Stream.of(getSelectors(getProject())) .allMatch(s -> s.isSelected(basedir, filename, file)); }
/** * @return a string representation of the selector */ public String toString() { StringBuilder buf = new StringBuilder(); if (hasSelectors()) { buf.append("{andselect: "); buf.append(super.toString()); buf.append("}"); } return buf.toString(); }
private void addIncludes(final FileSet fs) { final AndSelector fsIncludes = new AndSelector(); if (includes == null) { includes = new ArrayList<String>(1); } if (includes.size() == 0) { includes.add("**/*"); } for (final String inc : includes) { final FilenameSelector fns = new FilenameSelector(); fns.setName(inc); fsIncludes.add(fns); } fs.addAnd(fsIncludes); }
fs.setDir( nbmBuildDirFile ); OrSelector or = new OrSelector(); AndSelector and = new AndSelector(); FilenameSelector inc = new FilenameSelector(); inc.setName( "*/modules/**/*.jar" ); exModules } ); and.add( or ); and.add( ms ); fs.addAnd( and ); jnlpTask.execute();
fs.setDir( nbmBuildDirFile ); OrSelector or = new OrSelector(); AndSelector and = new AndSelector(); FilenameSelector inc = new FilenameSelector(); inc.setName( "*/modules/**/*.jar" ); exModules } ); and.add( or ); and.add( ms ); fs.addAnd( and ); jnlpTask.execute();