void (Project project) { FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor(); descriptor.setTitle(DevKitBundle.message("action.DumpCleanTestData.file.chooser.title")); descriptor.setDescription(DevKitBundle.message("action.DumpCleanTestData.file.chooser.source.description")); VirtualFile dirToProcess = FileChooser.chooseFile(descriptor, project, null); if (dirToProcess == null) return; descriptor.setDescription(DevKitBundle.message("action.DumpCleanTestData.file.chooser.destination.description")); VirtualFile destinationDir = FileChooser.chooseFile(descriptor, project, null); if (destinationDir == null) return; if (dirToProcess.equals(destinationDir)) { Messages.showErrorDialog(project, DevKitBundle.message("action.DumpCleanTestData.error.source.destination.must.differ"), CommonBundle.getErrorTitle()); return; } Path destination = destinationDir.toNioPath(); for (VirtualFile file : dirToProcess.getChildren()) { Document document = FileDocumentManager.getInstance().getDocument(file); if (document != null) { stripHighlightingData(document); try { Files.writeString(destination.resolve(file.getName()), document.getText(), file.getCharset()); } catch (IOException e) { LOG.error(e); } } } }