开发者

Java 7 new IO API - Paths.exists [duplicate]

开发者 https://www.devze.com 2023-02-13 09:30 出处:网络
This question already has answers here: How to check if a folder exists? (10 answers) Closed 7 years ago.
This question already has answers here: How to check if a folder exists? (10 answers) Closed 7 years ago.

Does anyone know what happened to the path.exists() API method in the latest Java 7 API? I cannot find the change in the change logs, and between b123 and b130, the method has been removed from the API.I see that there is a static Files.exists method but I'm not sure if that is the replacement o开发者_开发知识库r not.

Is anyone following the Java 7 work close enough to know how this should be handled?

Thanks for any help.


Files.exists

Look in the Files class for the static methods exists() and notExists(). Both take a Path.

I guess they decided it made more sense as a static rather than instance method.

0

精彩评论

暂无评论...
验证码 换一张
取 消