Replace exisiting on move to avoid random FileAlreadyExistsException

This commit is contained in:
Lukas Rieger (Blue) 2022-11-02 19:27:57 +01:00
parent 5f9716adc5
commit ddce10f6ab
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2

View File

@ -60,7 +60,7 @@ public static void move(Path from, Path to) throws IOException {
} catch (FileNotFoundException | NoSuchFileException ignore) {
} catch (IOException ex) {
try {
Files.move(from, to);
Files.move(from, to, StandardCopyOption.REPLACE_EXISTING);
} catch (FileNotFoundException | NoSuchFileException ignore) {}
}
}