boolean (File file) { if (myFiles.contains(file)) { return true; } if (!myDirectories.isEmpty() || !myRecursivelyExcludedDirectories.isEmpty()) { // optimization File parent = FileUtilRt.getParentFile(file); if (myDirectories.contains(parent)) { return true; } while (parent != null) { if (myRecursivelyExcludedDirectories.contains(parent)) { return true; } parent = FileUtilRt.getParentFile(parent); } } return false; }