[FIX] Loop в IOHelper.move

This commit is contained in:
Zaxar163 2020-04-14 18:37:24 +03:00
parent 72232e4cc7
commit 85400d968b

View file

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