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 default ContextPathMatcher which supports the matchOnUriPrefix option.
  • Field Details

    • path

      protected final String path
    • matchOnUriPrefix

      protected final boolean matchOnUriPrefix
  • Constructor Details

    • DefaultContextPathMatcher

      public DefaultContextPathMatcher(String path, boolean matchOnUriPrefix)
  • Method Details

    • matches

      public boolean matches(String path)
      Description copied from interface: ContextPathMatcher
      Whether the target context-path matches a regular url.
      Specified by:
      matches in interface ContextPathMatcher
      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 interface ContextPathMatcher
      Parameters:
      path - the context-path from the incoming HTTP request
      wildcard - 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 interface ContextPathMatcher
      Parameters:
      method - the request HTTP method
      restrict - the consumer configured HTTP restrict method
      Returns:
      true if matched, false otherwise
    • getPath

      public String getPath()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object