Java 7 new IO API - Paths.exists

JavaApiNio

Java Problem Overview


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 or not.

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

Thanks for any help.

Java Solutions


Solution 1 - Java

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEugenView Question on Stackoverflow
Solution 1 - JavaMJBView Answer on Stackoverflow