|
Java Source Codes
Copy files and folders
public void copyFolder(File fin, File fout) throws Exception
{
fout.mkdir();
String[] children = fin.list();
if (children == null) {
// Either dir does not exist or is not a directory
} else {
for(int p=0;p<children.length;p++){
File f = new File(fin+"/"+children[p]);
File f1 = new File(fout+"/"+children[p]);
if(f.isDirectory())
copyFolder(f,f1);
else
copyFile(f,f1);
}
}
}
<<<----- Return to
Java Source
Code Questions Page.
Have a Question ?
post your questions here. It
will be answered as soon as possible.
Check
Java Interview
Questions for more Java Interview Questions with answers
Check
Servlet Interview
Questions for more Servlet Interview Questions with answers
Check
Structs Interview
Questions for more Structs Interview Questions with answers
|