From 999c148dedfc935a10bc7bae67363ad7fc915cdd Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Thu, 30 Sep 2021 23:49:47 +0200 Subject: [PATCH] Add NoSuchFileException to be catched in AtomicFileHelper --- .../bluecolored/bluemap/core/util/AtomicFileHelper.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/AtomicFileHelper.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/AtomicFileHelper.java index 967dc6a3..2b2ebd78 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/AtomicFileHelper.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/AtomicFileHelper.java @@ -28,10 +28,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.OutputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.nio.file.StandardOpenOption; +import java.nio.file.*; public class AtomicFileHelper { @@ -52,11 +49,11 @@ public static OutputStream createFilepartOutputStream(final Path file) throws IO try { Files.move(partFile, file, StandardCopyOption.ATOMIC_MOVE); - } catch (FileNotFoundException ignore) { + } catch (FileNotFoundException | NoSuchFileException ignore) { } catch (IOException ex) { try { Files.move(partFile, file); - } catch (FileNotFoundException ignore) {} + } catch (FileNotFoundException | NoSuchFileException ignore) {} } }); }