1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Remove unnecessary rename in GZippedJsonDownloader

See #4361
This commit is contained in:
Cristian Maglie 2015-12-30 10:08:29 +01:00
parent 29912a0ac9
commit cce61f6aad

View File

@ -51,13 +51,12 @@ public class GZippedJsonDownloader {
public void download(File tmpFile, Progress progress, String statusText, ProgressListener progressListener) throws Exception {
try {
new JsonDownloader(downloader, gzippedUrl).download(tmpFile, progress, statusText, progressListener);
File gzipTmpFile = new File(tmpFile.getParentFile(), GzipUtils.getCompressedFilename(tmpFile.getName()));
// remove eventual leftovers from previous downloads
if (gzipTmpFile.exists()) {
gzipTmpFile.delete();
}
tmpFile.renameTo(gzipTmpFile);
new JsonDownloader(downloader, gzippedUrl).download(gzipTmpFile, progress, statusText, progressListener);
decompress(gzipTmpFile, tmpFile);
gzipTmpFile.delete();
} catch (Exception e) {