From a11764054c248245283a0504206c80d5101da81a Mon Sep 17 00:00:00 2001 From: Gravit Date: Mon, 20 May 2019 05:00:09 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0?= =?UTF-8?q?=20=D1=81=D0=BA=D0=B0=D1=87=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20ZIP=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launcher/downloader/ListDownloader.java | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java b/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java index 935bcd3b..f9e5a9a4 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java @@ -125,11 +125,25 @@ public Path handleResponse(HttpResponse response) throws IOException { try(ZipInputStream input = IOHelper.newZipInput(source)) { ZipEntry entry = input.getNextEntry(); - long size = entry.getSize(); - String filename = entry.getName(); - Path target = this.target.resolve(filename); - LogHelper.dev("Resolved filename %s to %s", filename, target.toAbsolutePath().toString()); - transfer(source, target, filename, size, callback, totalCallback); + while(entry != null) + { + if(entry.isDirectory()) + { + entry = input.getNextEntry(); + continue; + } + long size = entry.getSize(); + String filename = entry.getName(); + Path target = this.target.resolve(filename); + if(callback != null) + { + callback.stateChanged(entry.getName(), 0, entry.getSize()); + } + LogHelper.dev("Resolved filename %s to %s", filename, target.toAbsolutePath().toString()); + transfer(source, target, filename, size, callback, totalCallback); + entry = input.getNextEntry(); + } + } return null; }