|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.j2ep.rules.BaseRule net.sf.j2ep.rules.RewriteRule
public class RewriteRule
A rule using regular expressions to rewrite the URI. At first the expression will have to match the URI, after that the groups from the expression can be used to rewrite the URI.
Constructor Summary | |
---|---|
RewriteRule()
Basic constructor. |
Method Summary | |
---|---|
boolean |
matches(HttpServletRequest request)
Will check if the URI matches the pattern we have set up. |
java.lang.String |
process(java.lang.String uri)
Will use the pattern and the rewriteTo string to rewrite the URI before using it to connection to the end server. |
java.lang.String |
revert(java.lang.String uri)
Returns the reverted URI, this means that if a URI is processed and then reverted it should be the same URI. |
void |
setFrom(java.lang.String regex)
Sets the regex we will match incoming URIs on. |
void |
setRevertFrom(java.lang.String regex)
Sets the regex we use to match outgoing links found. |
void |
setRevertTo(java.lang.String to)
Sets the string we rewrite outgoing links to. |
void |
setTo(java.lang.String to)
Sets the string we will rewrite incoming URIs to. |
Methods inherited from class net.sf.j2ep.rules.BaseRule |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RewriteRule()
Method Detail |
---|
public boolean matches(HttpServletRequest request)
request
- The request
net.sf.j2ep.model.Rule#matches(javax.servlet.http.HttpServletRequest)
public java.lang.String process(java.lang.String uri)
process
in interface Rule
process
in class BaseRule
uri
- URI to be processed
Rule.process(java.lang.String)
public java.lang.String revert(java.lang.String uri)
Rule
revert
in interface Rule
revert
in class BaseRule
uri
- URI to be reverted
Rule.revert(java.lang.String)
public void setFrom(java.lang.String regex)
regex
- The regexpublic void setTo(java.lang.String to)
to
- The string we rewrite topublic void setRevertFrom(java.lang.String regex)
regex
- The regexpublic void setRevertTo(java.lang.String to)
to
- The string we rewrite to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |