reschke commented on code in PR #362: URL: https://github.com/apache/jackrabbit-filevault/pull/362#discussion_r1994823556
########## vault-core/src/main/java/org/apache/jackrabbit/vault/fs/api/FilterSet.java: ########## @@ -239,12 +243,68 @@ public boolean covers(@NotNull String path) { } /** - * Checks if the given item is an ancestor of the root node. + * Checks if the given path is an ancestor of the filter's root path. * @param path path of the item to check * @return {@code true} if the given item is an ancestor */ public boolean isAncestor(@NotNull String path) { - return path.equals(root) || root.startsWith(path + "/") || "/".equals(path); + boolean isAncestor = path.equals(root) || path.equals("/") || root.startsWith(path + "/"); + log.debug("isAncestor(root={}, path={}) -> {}", root, path, isAncestor); + return isAncestor; + } + + /** + * Matches the given path with this filter's root. If it is an ancestor, returns the name of the first + * path segment of the remaining filter root "below" path. If it's unrelated, return an empty string + * (indicating that no child node will ever math). Otherwise return {@code null).} + * + * @param path Path to check + * @return first path segment of non-matched path, or {@code null} when path not ancestor + */ + public @Nullable String getDirectChildNameTowardsFilterRoot(@NotNull String path) { Review Comment: In the unit tests, I assume? -- 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: dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org