Also replace file on first try

This commit is contained in:
Lukas Rieger (Blue) 2022-11-13 11:38:36 +01:00
parent 49ab38450e
commit 1a2d3a6d38
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2

View File

@ -56,7 +56,7 @@ public static OutputStream createFilepartOutputStream(final Path file) throws IO
*/
public static void move(Path from, Path to) throws IOException {
try {
Files.move(from, to, StandardCopyOption.ATOMIC_MOVE);
Files.move(from, to, StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING);
} catch (FileNotFoundException | NoSuchFileException ignore) {
} catch (IOException ex) {
try {