smengcl commented on a change in pull request #941:
URL: https://github.com/apache/hadoop-ozone/pull/941#discussion_r428264049



##########
File path: 
hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/OFSPath.java
##########
@@ -66,7 +70,13 @@
   static final String OFS_MOUNT_TMP_VOLUMENAME = "tmp";
 
   OFSPath(Path path) {
-    String pathStr = path.toUri().getPath();
+    URI uri = path.toUri();
+    // scheme is case-insensitive
+    if (!uri.getScheme().toLowerCase().equals(OZONE_OFS_URI_SCHEME)) {
+      throw new ParseException("Can't parse schemes other than ofs://.");
+    }
+    authority = uri.getAuthority();

Review comment:
       `initOFSPath` was designed to take a path without scheme or authority 
though. I didn't intend to change the parsing logic too much but I might do a 
refactoring to make it more consistent overall since you mentioned.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to