cshannon commented on code in PR #3511:
URL: https://github.com/apache/accumulo/pull/3511#discussion_r1237671541


##########
core/src/main/java/org/apache/accumulo/core/metadata/ValidationUtil.java:
##########
@@ -52,8 +56,13 @@ public static Path validate(Path path) {
   }
 
   public static void validateRFileName(String fileName) {
-    Objects.requireNonNull(fileName);
-    // TODO: In 3.0.0 validate that filename starts with FilePrefix
+    Preconditions.checkArgument(!StringUtils.isEmpty(fileName),
+        "Provided filename is null or empty.");
+
+    // This will make sure the prefix is valid and throw an 
IllegalArgumentException if the prefix
+    // does not match a known value
+    var unused = FilePrefix.fromPrefix(fileName.substring(0, 1));

Review Comment:
   I had put that in there as I've seen (I think) SpotBugs complain in the past 
but can definitely clean that up when I get some more time to work on this.



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

Reply via email to