Java 7 Nio Can replace


Working on a project that was using FileUtils.copy to copy a file from an InputStream to a File.

I decided to investigate the Nio package in Java 7 (and if you’re still using Java 6, please stop). In the docs for Files.copy ( was an example of downloading an html page to a file.

It’s very clean and also means I no longer need to depend on an external jar to perform many file operations.

Good bye commons-io. You’ve served me well, but I have a new ‘friend’.