void (@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(true); try { for (PsiElement element : myFileElements) { if (indicator.isCanceled()) break; VirtualFile file = ((PsiFileSystemItem)element).getVirtualFile(); aborted = file; Path path = file.toNioPath(); indicator.setText(path.toString()); try { NioFiles.deleteRecursively(path, p -> { indicator.checkCanceled(); indicator.setText2(path.relativize(p).toString()); }); processed.add(element); aborted = null; } catch (ProcessCanceledException ignored) { } } } catch (Throwable t) { Logger.getInstance(getClass()).info(t); error = t; } }