Monthly Archives: April 2012
I had my head banging against the wall recently with a project I am working on; what I thought would be a relatively simple task turned out to be quite the opposite, well for a new comer to Java at least: copying one directory to another using Java.
After a relentless search I came across a number of different approaches using varying techniques, all of which were either poorly documented, used out dated components, or had me reaching for my dunce hat.
I did eventually find a solution, it didn’t quite fit my needs perfectly so I have modified slightly and included within my FileUtils class which also allows directory creation; creds go to the anonymous author on exampledepot.
import java.io.File; import java.io.FileInputStream;