From 85400d968bb4e7676b6e140f15a57eda1ce46e90 Mon Sep 17 00:00:00 2001 From: Zaxar163 Date: Tue, 14 Apr 2020 18:37:24 +0300 Subject: [PATCH] =?UTF-8?q?[FIX]=20Loop=20=D0=B2=20IOHelper.move?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/pro/gravit/utils/helper/IOHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java index 1e8aeb5d..51c7ba40 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java @@ -199,13 +199,14 @@ private MoveFileVisitor(Path from, Path to) { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { - if (!IOHelper.isDir(dir)) Files.createDirectories(dir); + Path toDir = to.resolve(from.relativize(dir)); + if (!IOHelper.isDir(toDir)) Files.createDirectories(toDir); return FileVisitResult.CONTINUE; } @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - IOHelper.move(file, to.resolve(from.relativize(file))); + Files.move(file, to.resolve(from.relativize(file)), COPY_OPTIONS); return FileVisitResult.CONTINUE; }