List of utility methods to do URI to Relative URI
URI | relativize(URI baseURI, URI uriToRelativize) relativize URI relativizedURI; if (baseURI == null) { relativizedURI = uriToRelativize; } else { try { File file = new File(baseURI); if (!file.isDirectory()) { File parent = file.getParentFile(); ... |
URI | relativizeFromBase(String uri, URI base) relativize From Base return relativizeFromBase(URI.create(uri), base);
|
URI | resolve(String baseURI, String connectorURI) resolve return new URI(baseURI).resolve(new URI(connectorURI).getSchemeSpecificPart()); |
URI | resolve(String path, URI... relativeTo) resolve if (path == null) return null; final URI uri = new URI(path); if (uri.isAbsolute()) return uri; else { for (URI parent : relativeTo) { if (parent != null) { ... |
URI | resolve(URI base, URI child) resolve URI ruri = base.resolve(child); if ("file".equals(ruri.getScheme()) && !child.equals(ruri)) { if (base.getPath().startsWith("//") && !ruri.getPath().startsWith("//")) { String path = "///".concat(ruri.getPath()); try { ruri = new URI("file", null, path, ruri.getQuery(), ruri.getFragment()); } catch (URISyntaxException uris) { return ruri; |
URI | resolve(URI baseURI, String reference) Resolves a URI reference against a base URI. if (reference.isEmpty()) { return new URI(baseURI.getScheme(), baseURI.getSchemeSpecificPart(), null); if (WINDOWS_FILE_PATTERN.matcher(reference).lookingAt()) { return new File(reference).toURI(); reference = reference.replace('\\', '/'); URI refURI; ... |
URI | resolveAbsoluteURI(final URI relativeURI) resolve Absolute URI return getHtdocsDirectory().toURI().resolve(relativeURI);
|
File | resolveFile(final URI relativeURI) resolve File final File file = new File(resolveAbsoluteURI(relativeURI)); return file.isDirectory() ? new File(file, "index.html") : file; |
String | resolveFileName(URI uri) resolve File Name String url = uri.toString(); return url.substring(url.lastIndexOf('/') + 1, url.length()); |
String | resolveFileNameNoExt(URI uri) resolve File Name No Ext String fileName = resolveFileName(uri); return fileName.substring(0, fileName.lastIndexOf('.')); |