List of utility methods to do URI Create
URI | createURI(String path) create URI return new URI(path.replaceAll(" ", "%20")); |
URI | createURI(String path) Creates a URI from a path, the path can be relative or absolute, '\' and '/' are normalised. path = path.replace('\\', '/'); return URI.create(encodeURI(path)); |
URI | createURI(String scheme, String host, String path) create URI String uri = scheme + "://" + host + path; return createURI(uri); |
URI | createURI(String spec) create URI if (null == spec) { return null; } else { return new URI(spec); |
URI | createUri(String sUri, String defaultSchema, int deafultPort) It creates an URI from a String. String schema = defaultSchema; String host = null; int port = deafultPort; String path = ""; int index = sUri.indexOf("://"); if (index > -1) { schema = sUri.substring(0, index); sUri = sUri.substring(index + 3, sUri.length()); ... |
URI | createUri(String u) create Uri URI uri = URI.create(u); final String scheme = uri.getScheme(); if (scheme == null || !scheme.equalsIgnoreCase("http") && !scheme.equalsIgnoreCase("https")) { throw new IllegalArgumentException( "The URI scheme, of the URI " + u + ", must be equal (ignoring case) to 'http' or 'https'"); String path = uri.getPath(); if (path == null) { ... |
URI | createUri(String uri) Creates a URI from the specified string without throwing a URISyntaxException. try { return new URI(uri); } catch (URISyntaxException e) { return EMPTYURI; |
URI | createURI(String uri) create URI return URI.create("//" + parseCorrectURI(uri)); |
URI | createURI(String uri) Convenience method to turn a String into a URI without throwing any pesky checked exceptions. try { return new URI(uri); } catch (URISyntaxException e) { throw (IllegalArgumentException) new IllegalArgumentException("Bad URI: " + uri).initCause(e); |
URI | createURI(String uri) Escape the space in URL string if (uri == null) { return null; if (uri.indexOf('%') != -1) { return URI.create(uri); int index = uri.indexOf(':'); String scheme = null; ... |