OSDN Git Service

remove JSON file before create.
authorOlyutorskii <olyutorskii@users.osdn.me>
Sat, 2 May 2020 16:02:22 +0000 (01:02 +0900)
committerOlyutorskii <olyutorskii@users.osdn.me>
Sat, 2 May 2020 16:02:22 +0000 (01:02 +0900)
src/main/java/jp/sfjp/jindolf/config/ConfigStore.java

index 736c608..40b5c9e 100644 (file)
@@ -314,7 +314,13 @@ public class ConfigStore {
         String absPath = absFile.toString();
 
         try{
-            Files.delete(absFile);
+            Files.deleteIfExists(absFile);
+        }catch(IOException e){
+            // NOTHING
+            assert true;
+        }
+
+        try{
             Files.createFile(absFile);
         }catch(IOException e){
             LOGGER.log(Level.SEVERE,