public class RewriteRegexRule extends RegexRule implements Rule.ApplyURI
Rule.ApplyURI_handling, _terminating| Constructor and Description |
|---|
RewriteRegexRule() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
apply(java.lang.String target,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.util.regex.Matcher matcher)
Apply this rule to the request/response pair.
|
void |
applyURI(Request request,
java.lang.String oldTarget,
java.lang.String newTarget) |
void |
setReplacement(java.lang.String replacement)
Whenever a match is found, it replaces with this value.
|
java.lang.String |
toString()
Returns the replacement string.
|
getRegex, matchAndApply, setRegexisHandling, isTerminating, setHandling, setTerminatingpublic void setReplacement(java.lang.String replacement)
replacement - the replacement string.public java.lang.String apply(java.lang.String target,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.util.regex.Matcher matcher)
throws java.io.IOException
RegexRuleRegexRule.matchAndApply(String, HttpServletRequest, HttpServletResponse) if the regex matches.apply in class RegexRuletarget - field to attempt matchrequest - request objectresponse - response objectmatcher - The Regex matcher that matched the request (with capture groups available for replacement).java.io.IOException - exceptions dealing with operating on request or response objectspublic void applyURI(Request request, java.lang.String oldTarget, java.lang.String newTarget) throws java.io.IOException
applyURI in interface Rule.ApplyURIjava.io.IOExceptionCopyright © 2013 FuseSource, Corp.. All Rights Reserved.