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

      • TREE_TYPES

        protected static final String[] TREE_TYPES
    • Constructor Detail

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

      • isFolder

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