private Method getResourceMethod(Message m, String httpMethod) { String requestUri = HttpUtils.getPathToMatch(m, true); List<ClassResourceInfo> resources = JAXRSUtils.getRootResources(m); Map<ClassResourceInfo, MultivaluedMap<String, String>> matchedResources = JAXRSUtils.selectResourceClass(resources, requestUri, m); if (matchedResources == null) { return null; } MultivaluedMap<String, String> values = new MetadataMap<>(); OperationResourceInfo ori = findPreflightMethod(matchedResources, requestUri, httpMethod, values, m); return ori == null ? null : ori.getAnnotatedMethod(); }
return findPreflightMethod(Collections.singletonMap(subcri, newValues), values.getFirst(URITemplate.FINAL_MATCH_GROUP), httpMethod,
MultivaluedMap<String, String> newValues = new MetadataMap<String, String>(); newValues.putAll(values); return findPreflightMethod(subcri, values.getFirst(URITemplate.FINAL_MATCH_GROUP), httpMethod,
private Method getResourceMethod(Message m, String httpMethod) { String requestUri = HttpUtils.getPathToMatch(m, true); List<ClassResourceInfo> resources = JAXRSUtils.getRootResources(m); Map<ClassResourceInfo, MultivaluedMap<String, String>> matchedResources = JAXRSUtils.selectResourceClass(resources, requestUri, m); if (matchedResources == null) { return null; } MultivaluedMap<String, String> values = new MetadataMap<>(); OperationResourceInfo ori = findPreflightMethod(matchedResources, requestUri, httpMethod, values, m); return ori == null ? null : ori.getAnnotatedMethod(); }
return findPreflightMethod(Collections.singletonMap(subcri, newValues), values.getFirst(URITemplate.FINAL_MATCH_GROUP), httpMethod,
private Method getPreflightMethod(Message m, String httpMethod) { String requestUri = HttpUtils.getPathToMatch(m, true); Service service = m.getExchange().get(Service.class); List<ClassResourceInfo> resources = ((JAXRSServiceImpl)service).getClassResourceInfos(); MultivaluedMap<String, String> values = new MetadataMap<String, String>(); ClassResourceInfo resource = JAXRSUtils.selectResourceClass(resources, requestUri, values, m); if (resource == null) { return null; } OperationResourceInfo ori = findPreflightMethod(resource, requestUri, httpMethod, values, m); return ori == null ? null : ori.getAnnotatedMethod(); }