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.