Class AntPathRequestMatcher
java.lang.Object
com.codename1.backend.security.AntPathRequestMatcher
- All Implemented Interfaces:
RequestMatcher
Matches a request's path against an Ant-style pattern, and optionally its method.
?is one character and*any run of characters within one segment:/files/*.txt.**is any number of whole segments, none included:/api/**matches/api,/api/and/api/users/7.{name}is one segment, or the rest of one, bound to that name:/users/{id}.
The path compared is the one the routers compare -- the query removed and percent-escapes of unreserved characters resolved -- so a request cannot be spelled to match a rule here and a different route there. Matching is case sensitive, as routing is, and a trailing slash is part of the path.
-
Nested Class Summary
Nested classes/interfaces inherited from interface RequestMatcher
RequestMatcher.MatchResult -
Constructor Summary
ConstructorsConstructorDescriptionAntPathRequestMatcher(String pattern) AntPathRequestMatcher(String pattern, String method) -
Method Summary
Modifier and TypeMethodDescriptionstatic AntPathRequestMatcherantMatcher(String pattern) A matcher forpattern, any method.static AntPathRequestMatcherantMatcher(String method, String pattern) A matcher forpatternand one method, written as HTTP writes it:POST.matcher(HttpServer.Request request) The match with the variables it bound:{id}in a path pattern.booleanmatches(HttpServer.Request request) toString()Returns a string representation of the object.
-
Constructor Details
-
AntPathRequestMatcher
-
AntPathRequestMatcher
-
-
Method Details
-
antMatcher
A matcher forpattern, any method. -
antMatcher
A matcher forpatternand one method, written as HTTP writes it:POST. -
getPattern
-
matches
- Specified by:
matchesin interfaceRequestMatcher
-
matcher
Description copied from interface:RequestMatcherThe match with the variables it bound:{id}in a path pattern.- Specified by:
matcherin interfaceRequestMatcher
-
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-