List of utility methods to do URI to Path
String | getPath(final URI uri) get Path return isFileUri(uri) ? uri.getPath() : uri.toASCIIString();
|
String | getPath(final URI uri) Resolves the specified URI, and returns an absolute file system path to the resource represented by the URI. return getFile(uri).getAbsolutePath();
|
String | getPath(String uriStr) get Path URI uri = null; try { uri = new URI(uriStr); } catch (URISyntaxException e) { throw new RuntimeException(e.getLocalizedMessage()); return uri == null ? null : uri.getPath(); |
String | getPath(URI addr) get Path return getPathInternal(addr.getPath());
|
String | getPath(URI uri) get Path String path = uri.getPath(); if (path == null) { path = uri.getSchemeSpecificPart(); return path; |
URI | getPathAndQueryURI(URI requestUri) get Path And Query URI if (requestUri == null) { throw new NullPointerException("requestUri"); try { return new URI(null, null, requestUri.getPath(), requestUri.getQuery(), null); } catch (URISyntaxException e) { IllegalArgumentException ex = new IllegalArgumentException(requestUri.toString()); ex.initCause(e); ... |
String[] | getPathAsArray(URI uri) get Path As Array StringBuilder path = new StringBuilder(uri.getPath()); if (uri.getPath().equals("/") || uri.getPath().equals("\\")) { String back = "\"" + "\\" + "\""; String forward = "\"" + "/" + "\""; String ie = "(ie: " + back + " or " + forward + ")"; throw new RuntimeException("URI path cannot be a root " + ie); path.deleteCharAt(0); ... |
String | getPathByTrimmingEndingFileSeparator(URI uri) Trim eventual ending File#separator . Ex: "file:/a/b/c" -> "/a/b/c" "file:/a/b/c/" -> "/a/b/c" "file:/a/b/c.txt" -> "/a/b/c.txt" String path = uri.getPath(); if (path.endsWith(File.separator)) return path.substring(0, path.length() - 1); else return path; |
String[] | getPathComponents(URI uri) get Path Components if (uri == null || uri.getPath() == null) { return new String[0]; return uri.getPath().split("/"); |
String | getPathParamValue(URI uri) get Path Param Value return getODataParamValueAsString(uri, FORWARDING_URI_PARAM_NAME_PATH);
|