joerghoh commented on code in PR #416:
URL: 
https://github.com/apache/jackrabbit-filevault/pull/416#discussion_r2890169618


##########
vault-core/src/main/java/org/apache/jackrabbit/vault/fs/config/DefaultWorkspaceFilter.java:
##########
@@ -278,6 +280,45 @@ public boolean includesProperty(String propertyPath) {
         return false;
     }
 
+    @Override
+    public boolean isSubtreeFullyCovered(javax.jcr.Node subTree) throws 
RepositoryException {
+        if (subTree == null) {
+            return false;
+        }
+        String path = subTree.getPath();
+        if (isGloballyIgnored(path)) {
+            return false;
+        }
+        if (getCoveringFilterSet(path) == null) {
+            return false;
+        }
+        if (getImportMode(path) != ImportMode.REPLACE) {
+            return false;
+        }
+        return isSubtreeFullyOverwrittenRecursive(subTree);
+    }
+
+    private boolean isSubtreeFullyOverwrittenRecursive(javax.jcr.Node node) 
throws RepositoryException {
+        String nodePath = node.getPath();
+        if (!contains(nodePath)) {
+            return false;
+        }
+        PropertyIterator props = node.getProperties();
+        while (props.hasNext()) {
+            Property prop = props.nextProperty();
+            if (!includesProperty(prop.getPath())) {
+                return false;
+            }
+        }
+        NodeIterator children = node.getNodes();

Review Comment:
   And what about a filter with includes and excludes? In that case we would 
need to iterate down the tree...
   
   (given the frequency at which filters without includes and excludes occur, I 
can definitely add a shortcut without repo access.)



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