Rule.ApplyURI
public class RewriteRegexRule extends RegexRule implements Rule.ApplyURI
Rule.ApplyURI
_handling, _terminating
Constructor | Description |
---|---|
RewriteRegexRule() |
|
RewriteRegexRule(java.lang.String regex,
java.lang.String replacement) |
Modifier and Type | Method | 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(org.eclipse.jetty.server.Request request,
java.lang.String oldURI,
java.lang.String newURI) |
|
void |
setReplacement(java.lang.String replacement) |
Whenever a match is found, it replaces with this value.
|
java.lang.String |
toString() |
Returns the replacement string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRegex, matchAndApply, setRegex
isHandling, isTerminating, setHandling, setTerminating
public RewriteRegexRule()
public RewriteRegexRule(@Name("regex") java.lang.String regex, @Name("replacement") java.lang.String replacement)
public 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
RegexRule
RegexRule.matchAndApply(String, HttpServletRequest, HttpServletResponse)
if the regex matches.apply
in class RegexRule
target
- 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(org.eclipse.jetty.server.Request request, java.lang.String oldURI, java.lang.String newURI) throws java.io.IOException
applyURI
in interface Rule.ApplyURI
java.io.IOException
Copyright © 1995–2018 Webtide. All rights reserved.