How to tell why a file deletion fails in Java?
In Java 6, there is unfortunately no way to determine why a file cannot be deleted. With Java 7, you can use java.nio.file.Files#delete() instead, which will give you a detailed cause of the failure, if the file or directory cannot be deleted. Note that file.list() may return entries for directories, which can be deleted. The … Read more