@Override
protected HttpConsumer doResolve(HttpServletRequest request, String method, Map<String, HttpConsumer> consumers) {
HttpConsumer answer = null;
String path = request.getPathInfo();
if (path == null) {
return null;
}
List<RestConsumerContextPathMatcher.ConsumerPath> paths = new ArrayList<>();
for (final Map.Entry<String, HttpConsumer> entry : consumers.entrySet()) {
paths.add(new HttpRestConsumerPath(entry.getValue()));
}
RestConsumerContextPathMatcher.ConsumerPath<HttpConsumer> best = RestConsumerContextPathMatcher.matchBestPath(method, path, paths);
if (best != null) {
answer = best.getConsumer();
}
if (answer == null) {
answer = super.doResolve(request, method, consumers);
}
return answer;
}
}