Class DefaultContextPathMatcher
- java.lang.Object
-
- org.apache.camel.component.netty.http.DefaultContextPathMatcher
-
- All Implemented Interfaces:
ContextPathMatcher
- Direct Known Subclasses:
RestContextPathMatcher
public class DefaultContextPathMatcher extends Object implements ContextPathMatcher
A defaultContextPathMatcherwhich supports the matchOnUriPrefix option.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanmatchOnUriPrefixprotected Stringpath
-
Constructor Summary
Constructors Constructor Description DefaultContextPathMatcher(String path, boolean matchOnUriPrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetPath()inthashCode()booleanmatches(String path)Whether the target context-path matches a regular url.booleanmatchesRest(String path, boolean wildcard)Whether the target context-path matches a REST url.booleanmatchMethod(String method, String restrict)Matches the given request HTTP method with the configured HTTP method of the consumer
-
-
-
Field Detail
-
path
protected final String path
-
matchOnUriPrefix
protected final boolean matchOnUriPrefix
-
-
Constructor Detail
-
DefaultContextPathMatcher
public DefaultContextPathMatcher(String path, boolean matchOnUriPrefix)
-
-
Method Detail
-
matches
public boolean matches(String path)
Description copied from interface:ContextPathMatcherWhether the target context-path matches a regular url.- Specified by:
matchesin interfaceContextPathMatcher- Parameters:
path- the context-path from the incoming HTTP request- Returns:
- true to match, false if not.
-
matchesRest
public boolean matchesRest(String path, boolean wildcard)
Description copied from interface:ContextPathMatcherWhether the target context-path matches a REST url.- Specified by:
matchesRestin interfaceContextPathMatcher- Parameters:
path- the context-path from the incoming HTTP requestwildcard- whether to match strict or by wildcards- Returns:
- true to match, false if not.
-
matchMethod
public boolean matchMethod(String method, String restrict)
Description copied from interface:ContextPathMatcherMatches the given request HTTP method with the configured HTTP method of the consumer- Specified by:
matchMethodin interfaceContextPathMatcher- Parameters:
method- the request HTTP methodrestrict- the consumer configured HTTP restrict method- Returns:
- true if matched, false otherwise
-
getPath
public String getPath()
-
-