diff --git a/platform/lang-impl/src/com/intellij/platform/templates/github/DownloadUtil.java b/platform/lang-impl/src/com/intellij/platform/templates/github/DownloadUtil.java index 205df47a335a..14c6674d8153 100644 --- a/platform/lang-impl/src/com/intellij/platform/templates/github/DownloadUtil.java +++ b/platform/lang-impl/src/com/intellij/platform/templates/github/DownloadUtil.java @@ -69,6 +69,22 @@ public class DownloadUtil { } } + /** + * Downloads content of {@code url} to {@code outputFile} atomically. + * {@code outputFile} won't be modified in case of any I/O download errors. + * + * @param indicator progress indicator + * @param url url to download + * @param outputFile output file + */ + public static void downloadAtomically(@Nullable ProgressIndicator indicator, + @NotNull String url, + @NotNull File outputFile) throws IOException + { + File tempFile = FileUtil.createTempFile("for-actual-downloading-", null); + downloadAtomically(indicator, url, outputFile, tempFile, null); + } + /** * Downloads content of {@code url} to {@code outputFile} atomically. * {@code outputFile} won't be modified in case of any I/O download errors.