@ProviderType public final class PathInfoUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
getFirstSuffixSegment(org.apache.sling.api.SlingHttpServletRequest request)
Get the first suffix segment.
|
static String |
getLastSuffixSegment(org.apache.sling.api.SlingHttpServletRequest request)
Gets the last suffix segment.
|
static String |
getQueryParam(org.apache.sling.api.SlingHttpServletRequest request,
String key)
Get a named Query Parameter from the Request.
|
static String |
getQueryParam(org.apache.sling.api.SlingHttpServletRequest request,
String key,
String dfault)
Get a named Query Parameter from the Request.
|
static String |
getSelector(org.apache.sling.api.SlingHttpServletRequest request,
int index)
Gets the selector at the supplied index.
|
static String |
getSelector(org.apache.sling.api.SlingHttpServletRequest request,
int index,
String defaultValue)
Gets the selector at the supplied index, using a default if
there is no selector at that index.
|
static String |
getSuffix(org.apache.sling.api.SlingHttpServletRequest request)
Get the entire suffix.
|
static String |
getSuffixSegment(org.apache.sling.api.SlingHttpServletRequest request,
int index)
Gets the suffix segment at the supplied index.
|
static String[] |
getSuffixSegments(org.apache.sling.api.SlingHttpServletRequest request)
Gets the suffixes as an array; each segment is the text between the /'s.
|
public static String getQueryParam(org.apache.sling.api.SlingHttpServletRequest request, String key)
request - key - public static String getQueryParam(org.apache.sling.api.SlingHttpServletRequest request, String key, String dfault)
request - key - dfault - Value to return if Query Parameter value is blankpublic static String getSelector(org.apache.sling.api.SlingHttpServletRequest request, int index)
Given: /content/page.selA.selB.html
getSelector(request, 0) // --> "selA"
getSelector(request, 1) // --> "selB"
request - index - public static String getSelector(org.apache.sling.api.SlingHttpServletRequest request, int index, String defaultValue)
Gets the selector at the supplied index, using a default if there is no selector at that index.
Given: /content/page.selA.html
getSelector(request, 0, "default") // --> "selA"
getSelector(request, 1, "default2") // --> "default2"
request - the requestindex - the indexdefaultValue - the default valuepublic static String[] getSuffixSegments(org.apache.sling.api.SlingHttpServletRequest request)
request - public static String getSuffixSegment(org.apache.sling.api.SlingHttpServletRequest request, int index)
Gets the suffix segment at the supplied index.
Given: /content/page.html/suffixA/suffixB
getSuffixSegment(request, 0) // --> "suffixA"
getSuffixSegment(request, 1) // --> "suffixB"
request - index - public static String getSuffix(org.apache.sling.api.SlingHttpServletRequest request)
request - public static String getFirstSuffixSegment(org.apache.sling.api.SlingHttpServletRequest request)
request - public static String getLastSuffixSegment(org.apache.sling.api.SlingHttpServletRequest request)
request - Copyright © 2013–2020 Adobe. All rights reserved.