From 877c26199d1144cb7e3f66addb46a697d3785f32 Mon Sep 17 00:00:00 2001 From: Gravit Date: Tue, 21 May 2019 02:26:41 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B4=D0=B8=D1=80=D0=B5=D1=82=D0=BA=D0=BE=D1=80?= =?UTF-8?q?=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gravit/launcher/client/LauncherUpdateController.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/LauncherUpdateController.java b/Launcher/src/main/java/ru/gravit/launcher/client/LauncherUpdateController.java index aaae375f..b3f20052 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/LauncherUpdateController.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/LauncherUpdateController.java @@ -40,7 +40,10 @@ public void postDiff(UpdateRequest request, UpdateRequestEvent e, HashedDir.Diff AtomicReference lastEn = new AtomicReference<>(null); ArrayList removed = new ArrayList<>(); diff.mismatch.walk(File.separator, (path, name, entry) -> { - if(entry.getType() == HashedEntry.Type.DIR) return HashedDir.WalkAction.CONTINUE; + if(entry.getType() == HashedEntry.Type.DIR) { + Files.createDirectories(request.getDir().resolve(path)); + return HashedDir.WalkAction.CONTINUE; + } HashedFile file = (HashedFile) entry; //Первый экспериментальный способ - честно обходим все возможные Store Path ret = null; @@ -78,7 +81,7 @@ public void postDiff(UpdateRequest request, UpdateRequestEvent e, HashedDir.Diff Path source = request.getDir().resolve(path); LogHelper.debug("Copy file %s to %s", ret.toAbsolutePath().toString(), source.toAbsolutePath().toString()); //Let's go! - Files.copy(source, ret); + Files.copy(ret, source); removed.add(path.concat(File.separator).concat(name)); } }