We need to call file.exists() before file.delete() before we can delete a file E.g.
file.exists()
file.delete()
File file = ...; if (file.exists()){ fil
There's also the Java 7 solution, using the new(ish) Path abstraction:
Path fileToDeletePath = Paths.get("fileToDelete_jdk7.txt"); Files.delete(fileToDeletePath);
Hope this helps.