public class RightHandPathRule extends Object implements UriRule
This rule assumes that the pattern used to match this rule has certain contraints. If a pattern contains one or more capturing groups then the last capturing group MUST occur at the end of the pattern and MUST be '(/.*)?' or '(/)?'.
If the source from which the pattern was derived ends in a '/' and the matched path does not end in a '/' then a temporary redirect response is returned with a path that is the matched path appened with '/'.
Constructor and Description |
---|
RightHandPathRule(boolean redirect,
boolean patternEndsInSlash,
UriRule rule)
Public constructor.
|
public RightHandPathRule(boolean redirect, boolean patternEndsInSlash, UriRule rule)
redirect
- if true return a temporary redirect response if the
path does not end in '/' and the pattern ends in '/'.patternEndsInSlash
- true if the pattern used to match with rule
end in a '/', otherwise false.rule
- the URI rule that is adapted.public final boolean accept(CharSequence path, Object resource, UriRuleContext context)
Copyright © 2013 Oracle Corporation. All rights reserved.