javeme commented on code in PR #2022: URL: https://github.com/apache/incubator-hugegraph/pull/2022#discussion_r1027104354
########## hugegraph-core/src/main/java/com/baidu/hugegraph/util/ConfigUtil.java: ########## @@ -110,15 +110,17 @@ public static Map<String, String> scanGraphsDir(String graphsDirPath) { public static String writeToFile(String dir, String graphName, HugeConfig config) { - E.checkArgument(FileUtils.getFile(dir).exists(), - "The directory '%s' must exist", dir); - String fileName = Paths.get(dir, graphName + CONF_SUFFIX).toString(); + File file = FileUtils.getFile(dir); + E.checkArgument(file.exists(), + "The directory '%s' must exist", dir); + String fileName = file.getPath() + File.separator + graphName + CONF_SUFFIX; try { - config.save(new File(fileName)); + File newFile = FileUtils.getFile(fileName); + config.save(newFile); LOG.info("Write HugeConfig to file: '{}'", fileName); } catch (ConfigurationException e) { throw new HugeException("Failed to write HugeConfig to file '%s'", - e, fileName); + e, fileName); Review Comment: align ########## hugegraph-core/src/main/java/com/baidu/hugegraph/util/ConfigUtil.java: ########## @@ -110,15 +110,17 @@ public static Map<String, String> scanGraphsDir(String graphsDirPath) { public static String writeToFile(String dir, String graphName, HugeConfig config) { - E.checkArgument(FileUtils.getFile(dir).exists(), - "The directory '%s' must exist", dir); - String fileName = Paths.get(dir, graphName + CONF_SUFFIX).toString(); + File file = FileUtils.getFile(dir); + E.checkArgument(file.exists(), + "The directory '%s' must exist", dir); Review Comment: align ########## hugegraph-core/src/main/java/com/baidu/hugegraph/util/ConfigUtil.java: ########## @@ -110,15 +110,17 @@ public static Map<String, String> scanGraphsDir(String graphsDirPath) { public static String writeToFile(String dir, String graphName, HugeConfig config) { - E.checkArgument(FileUtils.getFile(dir).exists(), - "The directory '%s' must exist", dir); - String fileName = Paths.get(dir, graphName + CONF_SUFFIX).toString(); + File file = FileUtils.getFile(dir); Review Comment: rename to path? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@hugegraph.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org