List of utility methods to do URI Create
URI | create(final String uri) Creates or obtains a new URI;. final WeakReference<URI> ref = uris.get(uri); if (ref != null) { final URI res = ref.get(); if (res != null) { return res; final URI newUri = URI.create(uri.intern()); ... |
URI | createAbsoluteURI(URI base, String uri) Guarantees that the returned URI is absolute, no matter what the argument is. return createAbsoluteURI(base, URI.create(uri));
|
HttpURLConnection | createConnection(final String uri, final String authValue) create Connection final URL url = new URL(uri); final HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setConnectTimeout(0); connection.setReadTimeout(0); connection.setRequestMethod("GET"); connection.setRequestProperty("Authorization", authValue); connection.setDoOutput(true); return connection; ... |
String | createDatastream(String registrationUri, String APIKey, String xmlDescription) Attempts to create a new datastream. URL datastreamRegistrationURL = null; HttpURLConnection conn = null; OutputStream os = null; String result = null; byte[] bytesToPost = xmlDescription.getBytes(); String error = null; try { datastreamRegistrationURL = new URL(registrationUri); ... |
String | createDefaultName(final String uri) create Default Name String last = ""; java.net.URI _uri = null; try { _uri = new java.net.URI(uri); } catch (URISyntaxException e) { e.printStackTrace(); if (_uri != null) { ... |
URI | createExtensionUri(final String ext) Static helper to construct appropriate URIs for file-extensions format specifiers. return URI.create(EXT_URI_PREFIX + ext.toLowerCase());
|
URI | createURI() Returns a random, unique URI. return URI.create("urn:" + UUID.randomUUID()); |
URI | createUri(File file) create Uri return file.toURI();
|
URI | createURI(final String file) Crea una URI a partir de un nombre de fichero local o una URL. if (file == null || file.isEmpty()) { throw new IllegalArgumentException("No se puede crear una URI a partir de un nulo"); String filename = file.trim(); if ("".equals(filename)) { throw new IllegalArgumentException("La URI no puede ser una cadena vacia"); filename = filename.replace('\\', '/'); ... |
String | createUri(final String path) create Uri if (path.contains(":/")) { return path; try { return DUMMY_PREFIX + URLEncoder.encode(path, "UTF-8"); } catch (final UnsupportedEncodingException e) { throw new AssertionError(e); |