void (List<@NlsSafe String> paths) { new Task.Backgroundable(null, JavaUiBundle.message("quarantine.clean.progress"), true) { @Override public void run(@NotNull ProgressIndicator indicator) { for (@NlsSafe String path : paths) { indicator.checkCanceled(); indicator.setText2(path); try (Stream<Path> s = Files.walk(Paths.get(path))) { s.forEach(p -> { indicator.checkCanceled(); XAttrUtil.removeXAttr(p.toFile().getAbsolutePath(), QUARANTINE_ATTRIBUTE); }); } catch (IOException e) { throw new RuntimeException(e); } } } @Override public void onThrowable(@NotNull Throwable error) { LOG.warn(error); String title = JavaUiBundle.message("quarantine.cleaner"); String message = JavaUiBundle.message("quarantine.error.message", error.getMessage()); NotificationGroupManager.getInstance().getNotificationGroup("Quarantine Cleaner").createNotification(title, message, NotificationType.WARNING) .notify(null); } }.queue(); }