com.sun.jersey.server.impl.uri.rules
Class RightHandPathRule
java.lang.Object
com.sun.jersey.server.impl.uri.rules.RightHandPathRule
- All Implemented Interfaces:
- UriRule
public class RightHandPathRule
- extends Object
- implements UriRule
Adapter to an existing rule that accepts the rule using the last capturing
group value as the URI path.
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 '/'.
- Author:
- Paul.Sandoz@Sun.Com
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RightHandPathRule
public RightHandPathRule(boolean redirect,
boolean patternEndsInSlash,
UriRule rule)
- Parameters:
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.
accept
public final boolean accept(CharSequence path,
Object resource,
UriRuleContext context)
- Description copied from interface:
UriRule
- Accept the rule.
- Specified by:
accept
in interface UriRule
- Parameters:
path
- the URI pathresource
- the current resource instancecontext
- the rule context
- Returns:
- if true then the rule was accepted, if false then the rule was
not accepted.
Copyright © 2013 Oracle Corporation. All Rights Reserved.