imbajin commented on code in PR #2019:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2019#discussion_r1026545125


##########
hugegraph-core/src/main/java/org/apache/hugegraph/util/ConfigUtil.java:
##########
@@ -112,9 +112,11 @@ public static Map<String, String> scanGraphsDir(String 
graphsDirPath) {
 
     public static String writeToFile(String dir, String graphName,
                                      HugeConfig config) {
-        E.checkArgument(FileUtils.getFile(dir).exists(),
+        File file = FileUtils.getFile(dir);
+        E.checkArgument(file.exists(),
                         "The directory '%s' must exist", dir);
-        String fileName = Paths.get(dir, graphName + CONF_SUFFIX).toString();
+        String tmpGraphName = graphName + CONF_SUFFIX;

Review Comment:
   > in our case, fileName is "graphName.properties ", has one dot
   
   3 possible ways:
   1. we could assert only one `.` could exist
   2. we just truncate before `.` and get the graphName, then we add 
`.properties` as surffix later  (✅)
   3. we split by `.` and assert get 2 parts, then use `str[0]` & `str[1]`



-- 
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

Reply via email to