Tuesday, January 10, 2012

Java Copy and Download Files With Apache Commons Library

Take a look at org.apache.commons.io.FileUtils class.   It has methods that will make your life easier.

To download a remote file and save it to a local file:

FilesUtils.copyURLToFile(URL source, File destination)

Take a look at IOUtils class, too. 

No comments:

Post a Comment