cku328 commented on a change in pull request #812:
URL: https://github.com/apache/hadoop-ozone/pull/812#discussion_r416694492
##########
File path:
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/client/HddsClientUtils.java
##########
@@ -196,6 +196,24 @@ public static void verifyResourceName(String...
resourceNames) {
}
}
+ /**
+ * verifies that key name is a valid name.
+ *
+ * @param keyName key name to be validated
+ *
+ * @throws IllegalArgumentException
+ */
+ public static void verifyKeyName(String keyName) {
+ if (keyName == null) {
+ throw new IllegalArgumentException("Key name is null");
+ }
+ if(!OzoneConsts.KEYNAME_ILLEGAL_CHARACTER_CHECK_REGEX
+ .matcher(keyName).matches()){
+ throw new IllegalArgumentException("key name contains " +
+ "illegal characters.");
Review comment:
Thanks for the suggestion, I agree with you.
I'll wait for others' reviews and suggestions before I make this change.
----------------------------------------------------------------
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]