void (@NotNull ProgressIndicator indicator) { try { List<Pair<File, DownloadableFileDescription>> pairs = downloader.download(new File(DOWNLOAD_PATH)); Pair<File, DownloadableFileDescription> first = ContainerUtil.getFirstItem(pairs); File file = first != null ? first.first : null; if (file != null) { FileUtil.setExecutable(file); ShSettings.setShfmtPath(file.getCanonicalPath()); if (withReplace) { LOG.info("Remove old formatter"); FileUtil.delete(oldFormatter); } ApplicationManager.getApplication().invokeLater(onSuccess); EXTERNAL_FORMATTER_DOWNLOADED_EVENT_ID.log(); } } catch (IOException e) { LOG.warn("Can't download shfmt formatter", e); if (withReplace) rollbackToOldFormatter(formatter, oldFormatter); ApplicationManager.getApplication().invokeLater(onFailure); } }