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
This is my solution:
File f = new File("file.txt"); if(f.exists() && !f.isDirectory()) { f.delete(); }