List of utility methods to do URL to Path
String | getPath(String url) get Path try { URL tempUrl = new URL(url); return tempUrl.getPath(); } catch (MalformedURLException e) { throw new IllegalArgumentException("The url " + url + " is not valid."); |
String | getPath(String urlString) get Path try { URL url = new URL(urlString); return url.getPath(); } catch (MalformedURLException e) { throw e; |
String | getPath(URL theURL) get Path String file = theURL.getFile(); String path = null; if (file != null) { int q = file.lastIndexOf('?'); if (q != -1) { path = file.substring(0, q); } else { path = file; ... |
String | getPath(URL url) get Path return new File(url.getFile()).getPath(); |
String | getPath(URL url) get Path try { return url.toURI().getSchemeSpecificPart(); } catch (URISyntaxException use) { return url.getPath(); |
String | getPathFromURL(final String url) get Path From URL URL urlObj = new URL(url); return urlObj.getPath(); |
List | getPathParts(String url) get Path Parts return Arrays.asList(getPath(url).split(Pattern.quote("/"))); |