avijayanhwx commented on a change in pull request #1211:
URL: https://github.com/apache/hadoop-ozone/pull/1211#discussion_r456206292
##########
File path:
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java
##########
@@ -721,7 +723,13 @@ public String pathToKey(Path path) {
path = new Path(workingDir, path);
}
// removing leading '/' char
- String key = path.toUri().getPath().substring(1);
+ String key = path.toUri().getPath();
+
+ if (OzoneFSUtils.isValidName(key)) {
+ key = path.toUri().getPath().substring(1);
Review comment:
Can we just do this here, instead of toUri().getPath() again?
` LOG.trace("path for key:{} is:{}", key, path);
return key.substring(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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]