From b984fa9d734a42c30e6b90d2ddc854c267847785 Mon Sep 17 00:00:00 2001 From: zaxar163 Date: Tue, 8 Jan 2019 18:01:59 +0400 Subject: [PATCH] Next IOExc fix. --- .../java/ru/gravit/launchserver/binary/JARLauncherBinary.java | 1 + .../src/main/java/ru/gravit/utils/helper/UnpackHelper.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java index e05962d2..05f594c3 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java @@ -32,6 +32,7 @@ public JARLauncherBinary(LaunchServer server) throws IOException { guardDir = server.dir.resolve(Launcher.GUARD_DIR); buildDir = server.dir.resolve("build"); tasks = new ArrayList<>(); + Files.createDirectory(buildDir); } @Override diff --git a/libLauncher/src/main/java/ru/gravit/utils/helper/UnpackHelper.java b/libLauncher/src/main/java/ru/gravit/utils/helper/UnpackHelper.java index 460630cd..75709a15 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/helper/UnpackHelper.java +++ b/libLauncher/src/main/java/ru/gravit/utils/helper/UnpackHelper.java @@ -16,7 +16,7 @@ public static boolean unpack(URL resource, Path target) throws IOException { if (matches(target, resource)) return false; } Files.deleteIfExists(target); - Files.createFile(target); + IOHelper.createParentDirs(target); try (InputStream in = IOHelper.newInput(resource)) { IOHelper.transfer(in, target); }