void (@NotNull VirtualFile fromFile, final boolean dbOnly, @NotNull Consumer<VirtualFile> processor) { VfsUtilCore.visitChildrenRecursively(fromFile, new VirtualFileVisitor<Void>() { @NotNull @Override public Result visitFileEx(@NotNull VirtualFile file) { ProgressManager.checkCanceled(); if (isIgnoredByBuild(file)) { return SKIP_CHILDREN; } if (!file.isDirectory()) { processor.accept(file); } return CONTINUE; } @Nullable @Override public Iterable<VirtualFile> getChildrenIterable(@NotNull VirtualFile file) { if (dbOnly) { return file.isDirectory()? ((NewVirtualFile)file).iterInDbChildren() : null; } if (file.equals(fromFile) || !file.isDirectory()) { return null; // skipping additional checks for the initial file and non-directory files } // optimization: for all files that are not under content of currently opened projects iterate over DB children return isInContentOfOpenedProject(file)? null : ((NewVirtualFile)file).iterInDbChildren(); } }); }