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)); } }