public static boolean checkRequestURI(String servletPath, String uri) { boolean wildcard = uri.endsWith("*"); String theURI = wildcard ? uri.substring(0, uri.length() - 1) : uri; try { URITemplate template = new URITemplate(theURI); MultivaluedMap<String, String> map = new MetadataMap<>(); if (template.match(servletPath, map)) { String finalGroup = map.getFirst(URITemplate.FINAL_MATCH_GROUP); if (wildcard || StringUtils.isEmpty(finalGroup) || "/".equals(finalGroup)) { return true; } } } catch (Exception ex) { // ignore } return false; }
public static boolean checkRequestURI(String servletPath, String uri) { boolean wildcard = uri.endsWith("*"); String theURI = wildcard ? uri.substring(0, uri.length() - 1) : uri; try { URITemplate template = new URITemplate(theURI); MultivaluedMap<String, String> map = new MetadataMap<>(); if (template.match(servletPath, map)) { String finalGroup = map.getFirst(URITemplate.FINAL_MATCH_GROUP); if (wildcard || StringUtils.isEmpty(finalGroup) || "/".equals(finalGroup)) { return true; } } } catch (Exception ex) { // ignore } return false; }
public static boolean checkRequestURI(String servletPath, String uri) { boolean wildcard = uri.endsWith("*"); String theURI = wildcard ? uri.substring(0, uri.length() - 1) : uri; try { URITemplate template = new URITemplate(theURI); MultivaluedMap<String, String> map = new MetadataMap<>(); if (template.match(servletPath, map)) { String finalGroup = map.getFirst(URITemplate.FINAL_MATCH_GROUP); if (wildcard || StringUtils.isEmpty(finalGroup) || "/".equals(finalGroup)) { return true; } } } catch (Exception ex) { // ignore } return false; }
public List<ClassResourceInfo> getResourcesList(Message m, UriInfo ui) { final String slash = "/"; String path = ui.getPath(); if (!path.startsWith(slash)) { path = slash + path; } List<ClassResourceInfo> all = ((JAXRSServiceImpl)m.getExchange().getService()) .getClassResourceInfos(); boolean absolutePathSlashOn = checkAbsolutePathSlash && ui.getAbsolutePath().getPath().endsWith(slash); if (slash.equals(path) && !absolutePathSlashOn) { return all; } List<ClassResourceInfo> cris = new LinkedList<>(); for (ClassResourceInfo cri : all) { MultivaluedMap<String, String> map = new MetadataMap<>(); if (cri.getURITemplate().match(path, map) && slash.equals(map.getFirst(URITemplate.FINAL_MATCH_GROUP))) { cris.add(cri); } } return cris; }
public List<ClassResourceInfo> getResourcesList(Message m, UriInfo ui) { final String slash = "/"; String path = ui.getPath(); if (!path.startsWith(slash)) { path = slash + path; } List<ClassResourceInfo> all = ((JAXRSServiceImpl)m.getExchange().getService()) .getClassResourceInfos(); boolean absolutePathSlashOn = checkAbsolutePathSlash && ui.getAbsolutePath().getPath().endsWith(slash); if (slash.equals(path) && !absolutePathSlashOn) { return all; } List<ClassResourceInfo> cris = new LinkedList<>(); for (ClassResourceInfo cri : all) { MultivaluedMap<String, String> map = new MetadataMap<>(); if (cri.getURITemplate().match(path, map) && slash.equals(map.getFirst(URITemplate.FINAL_MATCH_GROUP))) { cris.add(cri); } } return cris; }
if (resources.size() == 1) { MultivaluedMap<String, String> values = new MetadataMap<>(); return resources.get(0).getURITemplate().match(path, values) ? Collections.singletonMap(resources.get(0), values) : null; if (cri.getURITemplate().match(path, map)) { candidateList.put(cri, map); LOG.fine(() -> new org.apache.cxf.common.i18n.Message("CRI_SELECTED_POSSIBLY",
if (uriTemplate != null && uriTemplate.match(path, map)) { String finalGroup = map.getFirst(URITemplate.FINAL_MATCH_GROUP); boolean finalPath = StringUtils.isEmpty(finalGroup) || PATH_SEGMENT_SEP.equals(finalGroup);
if (uriTemplate != null && uriTemplate.match(path, map)) { if (ori.isSubResourceLocator()) { candidateList.put(ori, map);