@Override public String getContentType() { return request.getContentType().getType(); }
@Override public String getContentType() { return request.getContentType().getType(); }
@Override public String contentType() { return request.getContentType().getType(); }
public String getContentType() { return request.getContentType().getType(); }
public ResolvedRequest resolve(Request request) { ResolvedRequest resolved = new ResolvedRequest(); String method = request.getMethod(); String path = RequestUtils.getUndecodedPath(request); ContentType requestContentType = request.getContentType(); /* get the route and the handler for this request */ Route route = router.route(path); if (route == null) { logger.error("could not find a route for " + path); resolved.errorStatus = Status.NOT_FOUND; return resolved; } String contentType = requestContentType != null ? requestContentType.getType() : null; HandlerKey key = new HandlerKey(method, route, contentType); RequestHandlerImpl handler = handlerMap.get(key); if (handler == null) { logger.error("could not find a handler for " + method + " - " + path + " - " + contentType); resolved.errorStatus = Status.METHOD_NOT_ALLOWED; return resolved; } resolved.handler = handler; resolved.route = route; resolved.key = key; return resolved; }