mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-29 05:55:57 +01:00
Add NoSuchFileException to be catched in AtomicFileHelper
This commit is contained in:
parent
e326939021
commit
999c148ded
@ -28,10 +28,7 @@
|
|||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.*;
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.StandardCopyOption;
|
|
||||||
import java.nio.file.StandardOpenOption;
|
|
||||||
|
|
||||||
public class AtomicFileHelper {
|
public class AtomicFileHelper {
|
||||||
|
|
||||||
@ -52,11 +49,11 @@ public static OutputStream createFilepartOutputStream(final Path file) throws IO
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Files.move(partFile, file, StandardCopyOption.ATOMIC_MOVE);
|
Files.move(partFile, file, StandardCopyOption.ATOMIC_MOVE);
|
||||||
} catch (FileNotFoundException ignore) {
|
} catch (FileNotFoundException | NoSuchFileException ignore) {
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
try {
|
try {
|
||||||
Files.move(partFile, file);
|
Files.move(partFile, file);
|
||||||
} catch (FileNotFoundException ignore) {}
|
} catch (FileNotFoundException | NoSuchFileException ignore) {}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user