I have to delete a property file from the path specified. I used the following code:
File f1 = new File("C:\\Equinox\\UIDesign\\root\\root.properties");
boolean success=f1.delete();
It returns false.
But a text file instead of property file is succesfully deleted.
There are a couple of reasons why
File.delete()can fail:The last one could be your own fault, if you’ve opened a FileInput/OutputStream for that file and forgot to close it.