java file.delete() returns false but file.exists() returns true

后端 未结 7 1528
心在旅途
心在旅途 2020-12-06 09:47

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

7条回答
  •  春和景丽
    2020-12-06 10:33

    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()

提交回复
热议问题