mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-03 22:30:31 +03:00
[FEATURE] launcherinstaller forge WIP
This commit is contained in:
parent
9112ca0c88
commit
ac15002327
2 changed files with 5 additions and 3 deletions
|
@ -7,6 +7,7 @@
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
@ -56,8 +57,9 @@ public static void downloadFile(URL url, Path file, Consumer<Integer> chanheTrac
|
||||||
public static void downloadZip(URL url, Path dir) throws IOException {
|
public static void downloadZip(URL url, Path dir) throws IOException {
|
||||||
try (ZipInputStream input = IOHelper.newZipInput(url)) {
|
try (ZipInputStream input = IOHelper.newZipInput(url)) {
|
||||||
for (ZipEntry entry = input.getNextEntry(); entry != null; entry = input.getNextEntry()) {
|
for (ZipEntry entry = input.getNextEntry(); entry != null; entry = input.getNextEntry()) {
|
||||||
if (entry.isDirectory())
|
if (entry.isDirectory()) {
|
||||||
continue; // Skip directories
|
Files.createDirectory(dir.resolve(IOHelper.toPath(entry.getName())));
|
||||||
|
}
|
||||||
// Unpack entry
|
// Unpack entry
|
||||||
String name = entry.getName();
|
String name = entry.getName();
|
||||||
LogHelper.subInfo("Downloading file: '%s'", name);
|
LogHelper.subInfo("Downloading file: '%s'", name);
|
||||||
|
|
2
modules
2
modules
|
@ -1 +1 @@
|
||||||
Subproject commit ee796454c63c6dcc39419f03fe1518326c7bcf20
|
Subproject commit 7f7a4bf268e70ee64d08baaa2049308332ddfc4e
|
Loading…
Reference in a new issue