0

I need to create a folder structure using java code. I have tried this:

new File("G:\a\b\c").mkdirs();

But how can I make files inside "a" folder or create another tree structure like "G:\a\m\k". I basically need to create a complete project structure just like eclipse does using "New Wizard".

  • Read [How to create a folder in Java?](http://stackoverflow.com/questions/3024002/how-to-create-a-folder-in-java) and [How to create a directory in Java?](http://stackoverflow.com/questions/3634853/how-to-create-a-directory-in-java) that might help you. – Braj Jun 21 '14 at 07:56
  • call it again `new File("G:\a\m\k").mkdirs();` to create another directory. – Braj Jun 21 '14 at 07:58
  • Calling it again worked,but how can I make .java files inside those folders? – user3607601 Jun 21 '14 at 08:02
  • Do you want to create a file in a folder? Read [How to create a file in a directory in java?](http://stackoverflow.com/questions/6142901/how-to-create-a-file-in-a-directory-in-java) and search on Google first. – Braj Jun 21 '14 at 08:02
  • yes, my main moto is to create a project structure programmatically. – user3607601 Jun 21 '14 at 08:04
  • So where is issue? Please post the code where you stuck. – Braj Jun 21 '14 at 08:05

0 Answers0