Class RequestPath


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean hasAnySelector​(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull java.lang.String @NotNull ... expectedSelectors)
      Checks if one of the given selectors is present in the current URL request (at any position).
      static boolean hasSelector​(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull java.lang.String expectedSelector)
      Checks if the given selector is present in the current URL request (at any position).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • hasSelector

        public static boolean hasSelector​(@NotNull
                                          @NotNull org.apache.sling.api.SlingHttpServletRequest request,
                                          @NotNull
                                          @NotNull java.lang.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 java.lang.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