Class FilterByNodeExistence

  • All Implemented Interfaces:
    FilterBy

    public class FilterByNodeExistence
    extends Object
    implements FilterBy
    Filters resources by absolute or relative node path. Only resources that (not) exist in the repository are accepted.
    Author:
    Vugar Aghayev
    • Constructor Detail

      • FilterByNodeExistence

        public FilterByNodeExistence​(@Nonnull
                                     String path,
                                     boolean nodeExists)
        Constructor
        Parameters:
        path - absolute or relative resource path
        nodeExists - node exists option
    • Method Detail

      • filter

        public boolean filter​(@Nonnull
                              org.apache.sling.api.resource.Resource resource,
                              StringBuilder output)
        Description copied from interface: FilterBy
        Checks if the given resource matches the filter criteria.
        Specified by:
        filter in interface FilterBy
        Parameters:
        resource - resource
        output - output buffer
        Returns:
        matches