techpreparation-homepage

Home  Interview Questions  Aptitude Questions  Tutorials  Placement Papers  Search  Resume Guide  Soft Skills  Video  Forum  Blog


Technical Interview Questions
Javascript Interview Questions
Oracle Interview Questions
J2EE Interview Questions
C++ Interview Questions
XML Interview Questions
EJB Interview Questions
JSP Interview Questions
                              .........More

Programming Source Codes
Java Source Codes
Html Source Codes
CSS Source Codes
C Source Codes
                              .........More

Soft Skills
Communication Skills
Leadership Skills
                              .........More

Subscribe to our Newsletters
Name:
Email:

 

 

  

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