void (@NotNull String toolShortName, @NotNull String downloadUrl) { String tempDirectory = FileUtil.getTempDirectory(); String filename = toolShortName + ".txt"; File downloadedFile = Paths.get(tempDirectory, filename).toFile(); if (downloadedFile.exists()) { //noinspection ResultOfMethodCallIgnored downloadedFile.delete(); } DownloadableFileService service = DownloadableFileService.getInstance(); DownloadableFileDescription description = service.createFileDescription(downloadUrl, filename); FileDownloader downloader = service.createDownloader(Collections.singletonList(description), "Download correct resolves file"); try { downloader.download(new File(tempDirectory)); } catch (IOException e) { LOGGER.error(e); } if (!downloadedFile.exists()) { LOGGER.error("Downloaded file doesn't exist"); } }