List of utility methods to do URI to Relative URI
String | resolveUri(URI base, String rel) resolve Uri try { URI relUri = new URI(rel); if (relUri.isAbsolute()) { return rel; } catch (URISyntaxException e) { String res; ... |
URI | resolveUri(URI baseUri, String resourceUriStr) resolve Uri URI targetUri = null; if (baseUri.toString().startsWith("jar:")) { URI temp = new URI(resourceUriStr); if (temp.isAbsolute()) { targetUri = temp; } else { URL targetUrl = new URL(baseUri.toURL(), resourceUriStr); targetUri = targetUrl.toURI(); ... |
URI | resolveUri(URI baseUri, URI requestedUri, URI matchedUri) resolve Uri String relativePath = requestedUri.getPath().substring(matchedUri.getPath().length()); String result = baseUri.toString() + relativePath; if (requestedUri.getQuery() != null) { result += "?" + requestedUri.getQuery(); return URI.create(result); |