Class RequestPath

java.lang.Object
io.wcm.sling.commons.request.RequestPath

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

    Modifier and Type
    Method
    Description
    static boolean
    hasAnySelector(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull 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 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 Details

    • 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