mirror of
https://github.com/arduino/Arduino.git
synced 2025-04-05 21:40:24 +02:00
parent
29912a0ac9
commit
cce61f6aad
@ -51,13 +51,12 @@ public class GZippedJsonDownloader {
|
|||||||
|
|
||||||
public void download(File tmpFile, Progress progress, String statusText, ProgressListener progressListener) throws Exception {
|
public void download(File tmpFile, Progress progress, String statusText, ProgressListener progressListener) throws Exception {
|
||||||
try {
|
try {
|
||||||
new JsonDownloader(downloader, gzippedUrl).download(tmpFile, progress, statusText, progressListener);
|
|
||||||
File gzipTmpFile = new File(tmpFile.getParentFile(), GzipUtils.getCompressedFilename(tmpFile.getName()));
|
File gzipTmpFile = new File(tmpFile.getParentFile(), GzipUtils.getCompressedFilename(tmpFile.getName()));
|
||||||
// remove eventual leftovers from previous downloads
|
// remove eventual leftovers from previous downloads
|
||||||
if (gzipTmpFile.exists()) {
|
if (gzipTmpFile.exists()) {
|
||||||
gzipTmpFile.delete();
|
gzipTmpFile.delete();
|
||||||
}
|
}
|
||||||
tmpFile.renameTo(gzipTmpFile);
|
new JsonDownloader(downloader, gzippedUrl).download(gzipTmpFile, progress, statusText, progressListener);
|
||||||
decompress(gzipTmpFile, tmpFile);
|
decompress(gzipTmpFile, tmpFile);
|
||||||
gzipTmpFile.delete();
|
gzipTmpFile.delete();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user