/** * Convert the URI to an output stream. * * @param uri * The uri */ public OutputStream createOutputStream(URI uri) throws IOException { URI converted = uri; if (platformProtocol.equals(converted.scheme())) { URL resolvedURL = resolvePlatform(new URL(converted.toString())); if (resolvedURL != null) { converted = URI.createFileURI(resolvedURL.getFile()); } } if (fileProtocol.equals(converted.scheme()) || converted.scheme() == null) { return openFileOutputStream(converted); } URL url = createURL(converted.toString()); URLConnection urlConnection = url.openConnection(); urlConnection.setDoOutput(true); return urlConnection.getOutputStream(); }