Package org.apache.sling.api.wrappers
Class RequestPathInfoWrapper
java.lang.Object
org.apache.sling.api.wrappers.RequestPathInfoWrapper
- All Implemented Interfaces:
RequestPathInfo
The
RequestPathInfoWrapper class is a default wrapper
class around a RequestPathInfo which may be extended to amend
the functionality of the original request path info object.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the extension from the URL ornullif the request URL does not contain an extension.@NotNull RequestPathInfoReturns the originalRequestPathInfoobject wrapped by this object.@NotNull StringReturn the "resource path" part of the URL, what comes before selectors, extension and suffix.@NotNull String[]Returns the selectors decoded from the request URL as an array of strings.@Nullable StringReturns the selectors decoded from the request URL as string.@Nullable StringReturns the suffix part of the URL ornullif the request URL does not contain a suffix.@Nullable ResourceReturns the resource addressed by the suffix or null if the request does not have a suffix or the suffix does not address an accessible resource.
-
Constructor Details
-
RequestPathInfoWrapper
-
-
Method Details
-
getRequestPathInfo
Returns the originalRequestPathInfoobject wrapped by this object.- Returns:
- The wrapped request path info.
-
getResourcePath
Description copied from interface:RequestPathInfoReturn the "resource path" part of the URL, what comes before selectors, extension and suffix. This string is part of the request URL and need not be equal to theResource.getPath(). Rather it is equal to theresolution path metadata propertyof the resource.- Specified by:
getResourcePathin interfaceRequestPathInfo- Returns:
- The resource path
-
getExtension
Description copied from interface:RequestPathInfoReturns the extension from the URL ornullif the request URL does not contain an extension.Decomposition of the request URL is defined in the Decomposition of a Request URL above.
- Specified by:
getExtensionin interfaceRequestPathInfo- Returns:
- The extension from the request URL.
-
getSelectorString
Description copied from interface:RequestPathInfoReturns the selectors decoded from the request URL as string. Returnsnullif the request has no selectors.Decomposition of the request URL is defined in the Decomposition of a Request URL above.
- Specified by:
getSelectorStringin interfaceRequestPathInfo- Returns:
- The selector string or
null - See Also:
-
getSelectors
Description copied from interface:RequestPathInfoReturns the selectors decoded from the request URL as an array of strings. This array is derived from theselector stringby splitting the string on dots. Returns an empty array if the request has no selectors.Decomposition of the request URL is defined in the Decomposition of a Request URL above.
- Specified by:
getSelectorsin interfaceRequestPathInfo- Returns:
- An array of selectors
- See Also:
-
getSuffix
Description copied from interface:RequestPathInfoReturns the suffix part of the URL ornullif the request URL does not contain a suffix.Decomposition of the request URL is defined in the Decomposition of a Request URL above.
- Specified by:
getSuffixin interfaceRequestPathInfo- Returns:
- The suffix part of the request URL.
-
getSuffixResource
Description copied from interface:RequestPathInfoReturns the resource addressed by the suffix or null if the request does not have a suffix or the suffix does not address an accessible resource.The suffix is expected to be the absolute path to the resource suitable as an argument to the
ResourceResolver.getResource(String)method.- Specified by:
getSuffixResourcein interfaceRequestPathInfo- Returns:
- The suffix resource or
null.
-