Skip to content

Commit 999c148

Browse files
committed
Add NoSuchFileException to be catched in AtomicFileHelper
1 parent e326939 commit 999c148

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/AtomicFileHelper.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@
2828
import java.io.FileNotFoundException;
2929
import java.io.IOException;
3030
import java.io.OutputStream;
31-
import java.nio.file.Files;
32-
import java.nio.file.Path;
33-
import java.nio.file.StandardCopyOption;
34-
import java.nio.file.StandardOpenOption;
31+
import java.nio.file.*;
3532

3633
public class AtomicFileHelper {
3734

@@ -52,11 +49,11 @@ public static OutputStream createFilepartOutputStream(final Path file) throws IO
5249

5350
try {
5451
Files.move(partFile, file, StandardCopyOption.ATOMIC_MOVE);
55-
} catch (FileNotFoundException ignore) {
52+
} catch (FileNotFoundException | NoSuchFileException ignore) {
5653
} catch (IOException ex) {
5754
try {
5855
Files.move(partFile, file);
59-
} catch (FileNotFoundException ignore) {}
56+
} catch (FileNotFoundException | NoSuchFileException ignore) {}
6057
}
6158
});
6259
}

0 commit comments

Comments
 (0)