List of utility methods to do URL Copy
void | copyURLToFile(final URL source, final File destination) copy URL To File if (destination.getParentFile() != null && !destination.getParentFile().exists()) { destination.getParentFile().mkdirs(); if (destination.exists() && !destination.canWrite()) { throw new IllegalArgumentException("Unable to open file " + destination + " for writing."); InputStream in = new BufferedInputStream(source.openStream()); copy(in, destination); ... |
void | copyURLToFile(URL source, File destination) Copies bytes from the URL source to a file destination .
InputStream input = source.openStream(); try { FileOutputStream output = openOutputStream(destination); try { copy(input, output); } finally { closeQuietly(output); } finally { closeQuietly(input); |