|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.j2ep.rules.BaseRule
net.sf.j2ep.rules.DirectoryRule
public class DirectoryRule
A rule that will check the start of the URI for a specifed starting directory/directories. If the directory is at the start this rule matches. The process method will then remove this directory from the URI, making it easy to map various servers to directory structures. If one needs some more advanced types of rewriting use the RewriteRule.
Constructor Summary | |
---|---|
DirectoryRule()
|
Method Summary | |
---|---|
java.lang.String |
getDirectory()
Returns the directory structure that this rule will match on. |
boolean |
matches(HttpServletRequest request)
Will see if the directory for the incoming URI is the same as this rule is set to match on. |
java.lang.String |
process(java.lang.String uri)
Removes the specified mapping directory from the URI. |
java.lang.String |
revert(java.lang.String uri)
Does the opposite of process. revert(String URI) will add the directory specified to the start of the incoming URI. |
void |
setDirectory(java.lang.String directory)
Sets the directory structure that will be mapped to a specified server. |
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 DirectoryRule()
Method Detail |
---|
public void setDirectory(java.lang.String directory)
directory
- The directory stringpublic java.lang.String getDirectory()
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)
revert
in interface Rule
revert
in class BaseRule
uri
- URI to be reverted
Rule.revert(java.lang.String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |