Package io.wcm.sling.commons.request
Class RequestPath
java.lang.Object
io.wcm.sling.commons.request.RequestPath
Utility methods when for sling paths and resources.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanhasAnySelector(@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 booleanhasSelector(@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).
-
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 requestexpectedSelector- 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 requestexpectedSelectors- Selectors string to check for.- Returns:
- true if the selector was found
-