mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Исправлена работа скачивания ZIP файла
This commit is contained in:
parent
5e1fb46aec
commit
a11764054c
1 changed files with 19 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue