You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/09/09 11:38:02 UTC

[GitHub] [incubator-iotdb] chrisdutz commented on a change in pull request #1714: [IOTDB-869] Failed to insert data via Windows CLI

chrisdutz commented on a change in pull request #1714:
URL: https://github.com/apache/incubator-iotdb/pull/1714#discussion_r485532207



##########
File path: server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
##########
@@ -118,12 +119,14 @@ public URL getPropsUrl() {
     else if(!urlString.endsWith(".properties")) {
       urlString += (File.separatorChar + IoTDBConfig.CONFIG_NAME);
     }
-    // If the url doesn't start with "file:" it's provided as a normal path.
-    // So we need to add it to make it a real URL.
-    if(!urlString.startsWith("file:")) {
-      urlString = "file:" + urlString;
-    }
+
+    // If the url doesn't start with "file:" or other protocols, it's provided as a normal path.
+    // If valid, we return a URL converted from this file path.
+    File confFile = new File(urlString);
     try {
+      if (confFile.exists()) {
+        return confFile.toURI().toURL();
+      }

Review comment:
       This change will again break the ability to load a config properites resource from classpath ...




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org