From 20ee5c2533725fa197864652437efcb6e52da491 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Tue, 1 Oct 2019 14:30:56 +0300 Subject: [PATCH] Fixed error on config file update --- .../com/djrapitops/plan/settings/config/ConfigWriter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/settings/config/ConfigWriter.java b/Plan/common/src/main/java/com/djrapitops/plan/settings/config/ConfigWriter.java index 805dc76d7..0f2689e7a 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/settings/config/ConfigWriter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/settings/config/ConfigWriter.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.StandardOpenOption; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -68,7 +69,8 @@ public class ConfigWriter { ConfigNode storedParent = writing.parent; writing.updateParent(null); - Files.write(outputPath, parseLines(writing), StandardCharsets.UTF_8); + Files.createDirectories(outputPath.getParent()); + Files.write(outputPath, parseLines(writing), StandardCharsets.UTF_8, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE); writing.updateParent(storedParent); }