This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes deleting directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "deleting directory" Watch "deleting directory" New topic
Author

deleting directory

Vaibhav Deshpande
Ranch Hand

Joined: Apr 26, 2002
Posts: 33
Hi,
I want to delete directory structure. but method delete() is not working since the files in this directory are not empty.
Is there any way to delete dir.
thanks in advance.
vebs
Carlos Failde
Ranch Hand

Joined: Oct 20, 2000
Posts: 84
You need to delete the files inside the directory before you can delete it. The contents may include directories which themselves might be nonempty so you are faced with the same problem.

The method first deletes the directory's contents and then finally deletes the directory itself. The method is recursive - if any of the contents are directories then they are in turn deleted in the same way.
 
jQuery in Action, 2nd edition
 
subject: deleting directory
 
Similar Threads
How can I force Tomcat 5.5 to clear it's cache of web apps?
Deploying a WAR file as root context
problem in IBMWebsphere deployment
Ant deleted the files within my webapps directory in Tomcat, but how do I make it delete the folder?
PLS Answer as soon as possible( Have a demo on monday) PLSSsss