Class AIResourceUtil


  • public class AIResourceUtil
    extends Object
    • Constructor Detail

      • AIResourceUtil

        public AIResourceUtil()
    • Method Detail

      • descendantsStream

        @Nonnull
        public static Stream<org.apache.sling.api.resource.Resource> descendantsStream​(@Nullable
                                                                                       org.apache.sling.api.resource.Resource resource)
        Returns a stream that goes through all descendants of a resource, parents come before their children.
        Parameters:
        resource - a resource or null
        Returns:
        a stream running through the resource and it's the descendants, not null
      • isOfNodeType

        public static boolean isOfNodeType​(@Nullable
                                           org.apache.sling.api.resource.Resource resource,
                                           @Nullable
                                           String nodetype)
        Checks whether a resource is of a certain node type - be that jcr:primaryType or a mixin.
        Parameters:
        resource - a resource or null
        nodetype - a node type or null ; if null we return false
        Returns:
        true if the resource is of the node type