Class TreeFilteringResourceVisitor

java.lang.Object
com.adobe.acs.commons.util.visitors.SimpleFilteringResourceVisitor
com.adobe.acs.commons.util.visitors.TreeFilteringResourceVisitor

public class TreeFilteringResourceVisitor extends SimpleFilteringResourceVisitor
Tree visitor which allows special cases such as how to handle child nodes which will not be traversed further. In short, all nodes identified as container/folder items will be visited recursively, and any child which is not a folder will be visited via a special case method. This allows a cleaner delineation of leaf nodes vs structure nodes.
  • Field Details

    • TREE_TYPES

      protected static final String[] TREE_TYPES
  • Constructor Details

    • TreeFilteringResourceVisitor

      public TreeFilteringResourceVisitor()
      Create a standard visitor for commonly used folder structures.
    • TreeFilteringResourceVisitor

      public TreeFilteringResourceVisitor(String... treeTypes)
      Create a visitor for a specific set of folder structures. This is useful for including other things such as nt:unstructured or oak folder types.
      Parameters:
      treeTypes - List of all node types to consider as folder-level containers.
  • Method Details

    • isFolder

      public final boolean isFolder(org.apache.sling.api.resource.Resource res)