File.ToPath Method

Definition

Returns a Path java.nio.file.Path object constructed from the this abstract path.

[Android.Runtime.Register("toPath", "()Ljava/nio/file/Path;", "GetToPathHandler", ApiSince=26)]
public virtual Java.Nio.FileNio.IPath ToPath ();
[<Android.Runtime.Register("toPath", "()Ljava/nio/file/Path;", "GetToPathHandler", ApiSince=26)>]
abstract member ToPath : unit -> Java.Nio.FileNio.IPath
override this.ToPath : unit -> Java.Nio.FileNio.IPath

Returns

a Path constructed from this abstract path

Attributes

Remarks

Returns a Path java.nio.file.Path object constructed from the this abstract path. The resulting Path is associated with the java.nio.file.FileSystems#getDefault default-filesystem.

The first invocation of this method works as if invoking it were equivalent to evaluating the expression: <blockquote>

{@link java.nio.file.FileSystems#getDefault FileSystems.getDefault}().{@link
            java.nio.file.FileSystem#getPath getPath}(this.{@link #getPath getPath}());

</blockquote> Subsequent invocations of this method return the same Path.

If this abstract pathname is the empty abstract pathname then this method returns a Path that may be used to access the current user directory.

Added in 1.7.

Java documentation for java.io.File.toPath().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to