Deleting directory

Java language is safe but weird. A lot of the times it doesn't what you think it does.
For example, if you do

File f= new File( path) and then do f.delete().

It won't be deleted if it's directory. It doesn't even throw exception. So you have to recursively delete all files and folders inside before you delete it.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>