Returns a URI to represent this path.
In the case of the default provider, the URI is hierarchical with
path component that is absolute. The query and
fragment components are undefined. Whether the authority component is
defined or not is implementation dependent. There is no guarantee that
URI may be used to construct a
In particular, if this path represents a Universal Naming Convention (UNC)
path, then the UNC server name may be encoded in the authority component
of the resulting URI. In the case of the default provider, and the file
exists, and it can be determined that the file is a directory, then the
URI will end with a slash.
The default provider provides a similar round-trip guarantee
java.io.File class. For a given
Path p it
is guaranteed that
so long as the original
URI, and the new
Pathare all created in (possibly different invocations of) the same Java virtual machine. Whether other providers make any guarantees is provider specific and therefore unspecified.
When a file system is constructed to access the contents of a file as a file system then it is highly implementation specific if the returned URI represents the given path in the file system or it represents a compound URI that encodes the URI of the enclosing file system. A format for compound URIs is not defined in this release; such a scheme may be added in a future release.
|if an I/O error occurs obtaining the absolute path, or where a file system is constructed to access the contents of a file as a file system, and the URI of the enclosing file system cannot be obtained|
| In the case of the default provider, and a security manager
is installed, the |