mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
'Download library' refactored a little
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user