private String doGetPath(boolean decode, boolean addSlash) { String path = HttpUtils.getPathToMatch(message, addSlash); return decode ? HttpUtils.pathDecode(path) : path; }
private String doGetPath(boolean decode, boolean addSlash) { String path = HttpUtils.getPathToMatch(message, addSlash); return decode ? HttpUtils.pathDecode(path) : path; }
private static String getPath(Message message) { String address = HttpUtils.getEndpointAddress(message); if (MessageUtils.isRequestor(message)) { return address; } String path = HttpUtils.getPathToMatch(message, false); return address + path; }
private static String getPath(Message message) { String address = HttpUtils.getEndpointAddress(message); if (MessageUtils.isRequestor(message)) { return address; } String path = HttpUtils.getPathToMatch(message, false); return address + path; }
public static String getPathToMatch(Message m, boolean addSlash) { String var = addSlash ? REQUEST_PATH_TO_MATCH_SLASH : REQUEST_PATH_TO_MATCH; String pathToMatch = (String)m.get(var); if (pathToMatch != null) { return pathToMatch; } String requestAddress = getProtocolHeader(m, Message.REQUEST_URI, "/"); if (m.get(Message.QUERY_STRING) == null) { int index = requestAddress.lastIndexOf('?'); if (index > 0 && index < requestAddress.length()) { m.put(Message.QUERY_STRING, requestAddress.substring(index + 1)); requestAddress = requestAddress.substring(0, index); } } String baseAddress = getBaseAddress(m); pathToMatch = getPathToMatch(requestAddress, baseAddress, addSlash); m.put(var, pathToMatch); return pathToMatch; }
public static String getPathToMatch(Message m, boolean addSlash) { String var = addSlash ? REQUEST_PATH_TO_MATCH_SLASH : REQUEST_PATH_TO_MATCH; String pathToMatch = (String)m.get(var); if (pathToMatch != null) { return pathToMatch; } String requestAddress = getProtocolHeader(m, Message.REQUEST_URI, "/"); if (m.get(Message.QUERY_STRING) == null) { int index = requestAddress.lastIndexOf('?'); if (index > 0 && index < requestAddress.length()) { m.put(Message.QUERY_STRING, requestAddress.substring(index + 1)); requestAddress = requestAddress.substring(0, index); } } String baseAddress = getBaseAddress(m); pathToMatch = getPathToMatch(requestAddress, baseAddress, addSlash); m.put(var, pathToMatch); return pathToMatch; }
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(); }
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(); }
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(); }
String rawPath = HttpUtils.getPathToMatch(message, true);
String rawPath = HttpUtils.getPathToMatch(message, true);