Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

neep help - files inside folder structure

 
sonali manchanda
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have an issue where I need to search through a folder which has many subfolders and the subfolders also have folders.... The folders have files inside them.I need to create a folder of a particular name inside all the folders which have atleast one file or more and move all the files from that folder level inside this newly created folder.

This behaviour should be uniform throughout the folder hierarchy i.e the new folder should be created at all levels where there is atleast one file present(there could be more than 1 file) and all those files at that level should be moved inside the newly created folder at the same level.


Please can someone help or post some sample code if possible.

Thanks

Sonali
 
Raymond Tong
Ranch Hand
Posts: 255
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java File I/O Tutorial
 
Swastik Dey
Rancher
Posts: 1604
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code snippet might give you some clue
 
Campbell Ritchie
Sheriff
Posts: 48924
58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic