Java 7中新的IO API - Paths.exists [英] Java 7 new IO API - Paths.exists
问题描述
有谁知道发生了什么事 path.exists()
最新的Java API 7在API的方法?
我找不到在更改日志的变化,B123和B130之间,该方法已经从API.I删除看到有一个静态 Files.exists
方法,但我不知道如果是这样的更换与否。
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.
有没有人下了Java 7的工作足够接近,知道应如何处理?
Is anyone following the Java 7 work close enough to know how this should be handled?
感谢您的帮助。
推荐答案
看在 文件
类的静态方法,<一个href=\"http://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#exists-java.nio.file.Path-java.nio.file.LinkOption...-\"相对=nofollow> 存在()
和<一个href=\"http://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#notExists-java.nio.file.Path-java.nio.file.LinkOption...-\"相对=nofollow> notExists()
。无论采取 路径
。
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.
这篇关于Java 7中新的IO API - Paths.exists的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!