Class RequestPath


  • @ProviderType
    public final class RequestPath
    extends Object
    Utility methods when for sling paths and resources.
    • Method Detail

      • hasSelector

        public static boolean hasSelector​(@NotNull
                                          @NotNull org.apache.sling.api.SlingHttpServletRequest request,
                                          @NotNull
                                          @NotNull String expectedSelector)
        Checks if the given selector is present in the current URL request (at any position).
        Parameters:
        request - Sling request
        expectedSelector - Selector string to check for.
        Returns:
        true if the selector was found
      • hasAnySelector

        public static boolean hasAnySelector​(@NotNull
                                             @NotNull org.apache.sling.api.SlingHttpServletRequest request,
                                             @NotNull
                                             @NotNull String @NotNull ... expectedSelectors)
        Checks if one of the given selectors is present in the current URL request (at any position).
        Parameters:
        request - Sling request
        expectedSelectors - Selectors string to check for.
        Returns:
        true if the selector was found