mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-09 00:59:44 +03:00
[FIX] Loop в IOHelper.move
This commit is contained in:
parent
72232e4cc7
commit
85400d968b
1 changed files with 3 additions and 2 deletions
|
@ -199,13 +199,14 @@ private MoveFileVisitor(Path from, Path to) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
|
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;
|
return FileVisitResult.CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
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;
|
return FileVisitResult.CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue