List of utility methods to do Path to URL
String | getURLPath(URL repositoryURL) get URL Path if ("file".equalsIgnoreCase(repositoryURL.getProtocol())) { File folder = new File(repositoryURL.getFile()); try { return (folder.getCanonicalPath()); } catch (IOException e) { return (folder.getAbsolutePath()); } else { ... |
String | getURLPath(URL url) Builds the path for an URL from path and an optional query return url.getPath() + (url.getQuery() == null ? "" : "?" + url.getQuery()); |
String | getUrlPath(URL url) get Url Path return (new File(URLDecoder.decode(url.getPath(), "UTF-8")).getAbsolutePath() + File.separator); |
String | getUrlPath(URL url) Returns the path portion from the given URL. StringBuilder buf = new StringBuilder(80); String tmp; if ((tmp = url.getPath()) != null) { if (!tmp.startsWith("/")) { buf.append("/"); buf.append(tmp); if ((tmp = url.getQuery()) != null) { buf.append("?"); buf.append(tmp); if ((tmp = url.getRef()) != null) { buf.append("#"); buf.append(tmp); return buf.toString(); |
String | getURLPathFromURI(String uri) get URL Path From URI String path = null; try { URL url = new URL(uri); path = url.getPath(); } catch (MalformedURLException e) { String urn = fixURN(uri); path = getURLPathFromURN(urn); return path; |
String | getURLPathFromURN(String urn) get URL Path From URN String path = null; URI uri = new java.net.URI(urn); path = urn.replaceAll("[:]", "/"); return path; |
URL[] | getURLs(List get UR Ls ArrayList<URL> urls = new ArrayList<URL>(); for (String p : paths) { urls.add(getURL(p)); return urls.toArray(new URL[urls.size()]); |
URL[] | getURLs(String thePaths[]) Returns the URLs for given paths. URL urls[] = new URL[thePaths.length]; for (int i = 0; i < thePaths.length; i++) urls[i] = getURL(thePaths[i]); return urls; |
List | getUrlsFromClassPath(String path) get Urls From Class Path List<URL> urls = new ArrayList<>(); try { Enumeration<URL> e = ClassLoader.getSystemResources(path); while (e.hasMoreElements()) { urls.add(e.nextElement()); } catch (IOException e) { return urls; |
String | getWebDocInfoStr(String urlPath) Gets the document info string return urlPath;
|