List of utility methods to do URL Create
URL | createURL(String url, String baseURI) Create URL using base URI. URL returnURL = null; URI uri = null; try { returnURL = new URL(url); uri = new URI(url); uri = uri.normalize(); returnURL = new URL(uri.toString()); catch (Exception mue) { int i = baseURI.lastIndexOf('/'); int j = baseURI.lastIndexOf('\\'); if (j > i) i = j; try { uri = new URI(baseURI.substring(0, i + 1) + url); uri = uri.normalize(); returnURL = uri.toURL(); } catch (Exception e) { return new URL(baseURI.substring(0, i + 1) + url); return returnURL; |
URL | createURL(String urlString) Create a URL from a string. return new URL(urlString); |
String | toUrl(String filename) to Url String url = "file:///" + filename.replace('\\', '/'); return url; |
String | toURL(String port, String address, String table) to URL return "jdbc:mysql://" + address + ":" + port + "/" + table + "?autoReconnect=true&useSSL=false"; |
String | toURL(String protocol, String host, int port, String path) to URL StringBuilder sb = new StringBuilder(); sb.append(protocol).append("://"); sb.append(host).append(':').append(port); if (path.charAt(0) != '/') sb.append('/'); sb.append(path); return sb.toString(); |
String | toUrl(String s) Creates a value of the formed expected by SVG href attribtues. return "url(#" + s + ")"; |
String | toUrl(String url) Converts '\\' to '/' in URL return url.replace("\\", "/"); |
String | toUrlDate(String date) to Url Date String[] s = date.split("-"); String da = s[2] + "-" + s[1] + "-" + s[0]; return da; |
String | toUrlPagePath(String pagePath) Converts a page path from real format to URL format. return (pagePath != null) ? pagePath.replace('/', ',') : null; |
String | toUrlParameterString(String fenString) to Url Parameter String return fenString.replace(' ', '.').replace('/', '_'); |