/** * Attempt to obtain an OutputStream from a URI. The simple case will open * it if it is local. Otherwise, it will call * uri.toURL().openConnection().getOutputStream(), however in some JVMs (MS * at least this fails where new FileOutputStream(url) works. * * @param uri * The URI to attempt to write to * @return An OutputStream connection * @throws IOException a problem with I/O happened */ public static OutputStream getOutputStream(URI uri) throws IOException { return getOutputStream(uri, false); }
OutputStream dataOut = NetUtil.getOutputStream(child); InputStream dataIn = zf.getInputStream(entry);
out = NetUtil.getOutputStream(dest);
/** * Store the properties at the location given by the uri using the supplied * title. * * @param properties * the properties to store * @param uri * the location of the store * @param title * the label held in the properties file * @throws IOException a problem with I/O happened */ public static void storeProperties(PropertyMap properties, URI uri, String title) throws IOException { OutputStream out = null; try { out = NetUtil.getOutputStream(uri); PropertyMap temp = new PropertyMap(); temp.putAll(properties); temp.store(out, title); } finally { IOUtil.close(out); } }