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 defaultContextPathMatcher
which supports the matchOnUriPrefix option.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
matchOnUriPrefix
protected String
path
-
Constructor Summary
Constructors Constructor Description DefaultContextPathMatcher(String path, boolean matchOnUriPrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getPath()
int
hashCode()
boolean
matches(String path)
Whether the target context-path matches a regular url.boolean
matchesRest(String path, boolean wildcard)
Whether the target context-path matches a REST url.boolean
matchMethod(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:ContextPathMatcher
Whether the target context-path matches a regular url.- Specified by:
matches
in 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:ContextPathMatcher
Whether the target context-path matches a REST url.- Specified by:
matchesRest
in 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:ContextPathMatcher
Matches the given request HTTP method with the configured HTTP method of the consumer- Specified by:
matchMethod
in interfaceContextPathMatcher
- Parameters:
method
- the request HTTP methodrestrict
- the consumer configured HTTP restrict method- Returns:
- true if matched, false otherwise
-
getPath
public String getPath()
-
-