dlmarion commented on code in PR #3549:
URL: https://github.com/apache/accumulo/pull/3549#discussion_r1245447110
##########
core/src/main/java/org/apache/accumulo/core/metadata/ValidationUtil.java:
##########
@@ -62,9 +62,12 @@ public static void validateRFileName(String fileName) {
public static void validateFileName(String fileName) {
Objects.requireNonNull(fileName);
- if (!fileName.matches("[\\dA-Za-z._-]+")) {
- throw new IllegalArgumentException(
- "Provided filename (" + fileName + ") contains invalid characters.");
+ for (int i = 0; i < fileName.length(); i++) {
+ final char ch = fileName.charAt(i);
+ if (!(Character.isLetterOrDigit(ch) || ch == '-' || ch == '.' || ch ==
'_')) {
+ throw new IllegalArgumentException(
+ "Provided filename (" + fileName + ") contains invalid
characters.");
+ }
Review Comment:
I would be interested in the benchmark numbers with the final implementation.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]