public interface RemotePathResolver
Modifier and Type | Method and Description |
---|---|
java.nio.file.Path |
forceLocalPath(java.net.URI path)
Same as
toLocalPath , but forcibly converts
the input into a local path instead of returning empty when it can't
be resolved using remote-to-local mappings. |
java.util.Optional<java.nio.file.Path> |
toLocalPath(java.net.URI remotePath)
Resolves a remote path into a local one.
|
java.util.Optional<java.nio.file.Path> toLocalPath(java.net.URI remotePath)
RemoteMount
. If no remote-to-local
mappings have been configured or none of them can be used to resolve
the remote path, then empty is returned.remotePath
- a file URI pointing to a file on a remote device
connected to this machine through a suitable mount
point.java.lang.NullPointerException
- if the argument is null
.java.nio.file.Path forceLocalPath(java.net.URI path)
toLocalPath
, but forcibly converts
the input into a local path instead of returning empty when it can't
be resolved using remote-to-local mappings.
Here "forcibly" means we blindly assume the URI is that of a local
file that the Paths
can convert to a Path
.path
- a file URI pointing to a file on a remote device connected
to this machine through a suitable mount point or a file URI
of a local file.java.lang.NullPointerException
- if the argument is null
.java.lang.IllegalArgumentException
- if the argument is not a file URI
(i.e. doesn't have a "file" scheme) or it is a remote file URI (i.e.
has a host component) but can't be resolved to a local file using
remote-to-local mappings.