When I am trying to delete a file which is present in tomcat server conf/Catalina/localhost from java code then file.delete() always returns false. But if I am checking the
before deleting the file your should close all the file reading and writing connection after 100% file will be deleted
for example
buffedreader.close()
outputstream.close()