'Download library' refactored a little

This commit is contained in:
Sergey Simonchik
2013-11-08 19:33:19 +04:00
parent 946216e607
commit e9e6eb2b67
@@ -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.