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
If the directory is non-empty then File.delete() method will return false without throwing an Error.
File.delete()
You must cleanup the directory before deleting it.