void (@NotNull VirtualFile file) { try { VfsUtilCore.visitChildrenRecursively(file, new VirtualFileVisitor<Void>() { @Override public boolean visitFile(@NotNull VirtualFile file) { // Since this code is invoked from New Project Wizard it's very possible that VFS isn't loaded to memory yet, so we need to do it // manually, otherwise refresh will do nothing myProgressIndicator.checkCanceled(); return !(file.isDirectory() && SKIPPED_DIRECTORIES.contains(file.getName())); } }); file.refresh(false, true); VfsUtilCore.visitChildrenRecursively(file, new VirtualFileVisitor<Void>() { @Override public boolean visitFile(@NotNull VirtualFile file) { myProgressIndicator.checkCanceled(); if (file.isDirectory() && SKIPPED_DIRECTORIES.contains(file.getName()) || !myProcessedFiles.add(file)) { return false; } if (!file.isDirectory()) { final FileType fileType = file.getFileType(); if (myDetectorsByFileType.containsKey(fileType)) { myProgressIndicator.setText2(file.getPresentableUrl()); try { final FileContent fileContent = FileContentImpl.createByFile(file, myContext.getProject()); for (FrameworkDetectorData detector : myDetectorsByFileType.get(fileType)) { if (detector.myFilePattern.accepts(fileContent)) { detector.mySuitableFiles.add(file); } } } catch (IOException e) { LOG.info(e); } } } return true; } }); } catch (ProcessCanceledException ignored) { } }