mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Исправление сжатия JAR
This commit is contained in:
parent
9da5191738
commit
189f63efc3
1 changed files with 12 additions and 2 deletions
|
@ -6,6 +6,7 @@
|
|||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.zip.Deflater;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
|
@ -28,9 +29,18 @@ public Path process(Path inputFile) throws IOException {
|
|||
{
|
||||
outputStream.setMethod(ZipOutputStream.DEFLATED);
|
||||
outputStream.setLevel(Deflater.BEST_COMPRESSION);
|
||||
try(ZipInputStream inputStream = IOHelper.newZipInput(inputFile))
|
||||
try(ZipInputStream input = IOHelper.newZipInput(inputFile))
|
||||
{
|
||||
|
||||
ZipEntry e = input.getNextEntry();
|
||||
while (e != null) {
|
||||
if (e.isDirectory()) {
|
||||
e = input.getNextEntry();
|
||||
continue;
|
||||
}
|
||||
outputStream.putNextEntry(IOHelper.newZipEntry(e));
|
||||
IOHelper.transfer(input, outputStream);
|
||||
e = input.getNextEntry();
|
||||
}
|
||||
}
|
||||
}
|
||||
return output;
|
||||
|
|
Loading…
Reference in a new issue