boolean (@NotNull File root, @Nullable FileFilter fileFilter) { if (fileFilter == null) { return true; } File file = root; do { if (!fileFilter.accept(file)) { return false; } file = file.getParentFile(); } while (file != null); return true; }