Class RedirectConfiguration
java.lang.Object
com.adobe.acs.commons.redirects.models.RedirectConfiguration
A collection of redirect rules
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRedirectConfiguration(org.apache.sling.api.resource.Resource resource, String storageSuffix) -
Method Summary
Modifier and TypeMethodDescriptiongetName()getPath()Match a request path to a redirect configuration Performs two tries: Match by exact path.match(String resourcePath, String contextPrefix, org.apache.sling.api.SlingHttpServletRequest request) Match a request path to a redirect configuration Performs two tries: Match by exact path.static StringnormalizePath(String resourcePath)
-
Field Details
-
EMPTY
-
-
Constructor Details
-
RedirectConfiguration
-
-
Method Details
-
normalizePath
- Returns:
- resource path without .html extension
-
getPathRules
-
getCaseInsensitivePathRules
-
getPatternRules
-
getPath
-
getName
-
match
Match a request path to a redirect configuration Performs two tries:- Match by exact path. This is O(1) lookup in a hashtable keyed by path
- Match by a regular expression. This is O(N) linear lookup in a list of rules keyed by their regex patterns
- Parameters:
requestPath- the request to match- Returns:
- match or null
- See Also:
-
match
public RedirectMatch match(String resourcePath, String contextPrefix, org.apache.sling.api.SlingHttpServletRequest request) Match a request path to a redirect configuration Performs two tries:- Match by exact path. This is O(1) lookup in a hashtable keyed by path
- Match by a regular expression. This is O(N) linear lookup in a list of rules keyed by their regex patterns
- Parameters:
resourcePath- the request to matchcontextPrefix- the optional context prefix to take into accountrequest- the current sling request- Returns:
- match or null
-