diff --git a/hugegraph-core/src/main/java/org/apache/hugegraph/util/ConfigUtil.java b/hugegraph-core/src/main/java/org/apache/hugegraph/util/ConfigUtil.java index 6e080faed2..7607cc4a55 100644 --- a/hugegraph-core/src/main/java/org/apache/hugegraph/util/ConfigUtil.java +++ b/hugegraph-core/src/main/java/org/apache/hugegraph/util/ConfigUtil.java @@ -118,7 +118,8 @@ public static String writeToFile(String dir, String graphName, String tmpGraphName = graphName + CONF_SUFFIX; String fileName = Paths.get(dir, tmpGraphName).toString(); try { - config.save(new File(fileName)); + File newFile = new File(fileName); + config.save(newFile); LOG.info("Write HugeConfig to file: '{}'", fileName); } catch (ConfigurationException e) { throw new HugeException("Failed to write HugeConfig to file '%s'",