Iterable<VirtualFile> (@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(); }