Alternative to File.exists() in Java

后端 未结 6 1387
没有蜡笔的小新
没有蜡笔的小新 2020-12-06 07:14

I never thought it would happen to me, but I ran into my first bug in Java:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5003595

I\'m pretty much in th

6条回答
  •  臣服心动
    2020-12-06 07:48

    I notice that Java 7's java.nio.file.Path.exists() method returns false if the file doesn't exist or it's existence can't be determined. It would seem, therefore, that false negatives will be around for a while and that your code will need to tolerate them.

提交回复
热议问题