public List<String> getMatchedURIs(boolean decode) { if (stack != null) { List<String> objects = new ArrayList<String>(); List<String> uris = new LinkedList<String>(); String sum = ""; for (MethodInvocationInfo invocation : stack) { OperationResourceInfo ori = invocation.getMethodInfo(); URITemplate[] paths = {ori.getClassResourceInfo().getURITemplate(), ori.getURITemplate()}; for (URITemplate t : paths) { if (t != null) { String v = t.getValue(); sum += "/" + (decode ? HttpUtils.pathDecode(v) : v); } } UriBuilder ub = UriBuilder.fromPath(sum); objects.addAll(invocation.getTemplateValues()); uris.add(0, ub.build(objects.toArray()).normalize().getPath()); } return uris; } LOG.fine("No resource stack information, returning empty list"); return Collections.emptyList(); }