/** * Returns true (the file is selected) only if the if property (if any) * exists, the unless property (if any) doesn't exist, and the * contained selector (if any) selects the file. If there is no contained * selector, return true (because we assume that the point was to test * the if and unless conditions). * * @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 */ @Override public boolean isSelected(File basedir, String filename, File file) { validate(); // Deal with if and unless properties first if (!passesConditions()) { return false; } Enumeration<FileSelector> e = selectorElements(); return !e.hasMoreElements() || e.nextElement().isSelected(basedir, filename, file); } }