Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/java/nio/file/Path#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/nio/file/Path#inhmethods)

# Path


`
public


interface
Path
`


`


implements

https://developer.android.com/reference/java/lang/Comparable<https://developer.android.com/reference/java/nio/file/Path>,

https://developer.android.com/reference/java/lang/Iterable<https://developer.android.com/reference/java/nio/file/Path>,

https://developer.android.com/reference/java/nio/file/Watchable


`

|---|
| java.nio.file.Path |

<br />

*** ** * ** ***

An object that may be used to locate a file in a file system. It will
typically represent a system dependent file path.

A `Path` represents a path that is hierarchical and composed of a
sequence of directory and file name elements separated by a special separator
or delimiter. A *root component* , that identifies a file system
hierarchy, may also be present. The name element that is *farthest*
from the root of the directory hierarchy is the name of a file or directory.
The other name elements are directory names. A `Path` can represent a
root, a root and a sequence of names, or simply one or more name elements.
A `Path` is considered to be an *empty path* if it consists
solely of one name element that is empty. Accessing a file using an
*empty path* is equivalent to accessing the default directory of the
file system. `Path` defines the `https://developer.android.com/reference/java/nio/file/Path#getFileName()`,
`https://developer.android.com/reference/java/nio/file/Path#getParent()`, `https://developer.android.com/reference/java/nio/file/Path#getRoot()`, and `https://developer.android.com/reference/java/nio/file/Path#subpath(int,%20int)` methods to access the path components or a subsequence of its name
elements.

In addition to accessing the components of a path, a `Path` also
defines the `https://developer.android.com/reference/java/nio/file/Path#resolve(java.nio.file.Path)` and `https://developer.android.com/reference/java/nio/file/Path#resolveSibling(java.nio.file.Path)` methods to combine paths. The `https://developer.android.com/reference/java/nio/file/Path#relativize(java.nio.file.Path)`
method that can be used to construct a relative path between two paths.
Paths can be `https://developer.android.com/reference/java/lang/Comparable#compareTo(T)`, and tested against each other using
the `https://developer.android.com/reference/java/nio/file/Path#startsWith(java.lang.String)` and `https://developer.android.com/reference/java/nio/file/Path#endsWith(java.lang.String)` methods.

This interface extends `https://developer.android.com/reference/java/nio/file/Watchable` interface so that a directory
located by a path can be `https://developer.android.com/reference/java/nio/file/Path#register(java.nio.file.WatchService,%20java.nio.file.WatchEvent.Kind<?>[])` with a `https://developer.android.com/reference/java/nio/file/WatchService` and entries in the directory watched.

**WARNING:** This interface is only intended to be implemented by
those developing custom file system implementations. Methods may be added to
this interface in future releases.

## Accessing Files

Paths may be used with the `https://developer.android.com/reference/java/nio/file/Files` class to operate on files,
directories, and other types of files. For example, suppose we want a `https://developer.android.com/reference/java/io/BufferedReader` to read text from a file "`access.log`". The
file is located in a directory "`logs`" relative to the current working
directory and is UTF-8 encoded.

```
    Path path = FileSystems.getDefault().getPath("logs", "access.log");
    BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8);
```

## Interoperability

Paths associated with the default `https://developer.android.com/reference/java/nio/file/spi/FileSystemProvider` are generally interoperable
with the `https://developer.android.com/reference/java/io/File` class. Paths created by other
providers are unlikely to be interoperable with the abstract path names
represented by `java.io.File`. The `https://developer.android.com/reference/java/io/File#toPath()`
method may be used to obtain a `Path` from the abstract path name
represented by a `java.io.File` object. The resulting `Path` can
be used to operate on the same file as the `java.io.File` object. In
addition, the `https://developer.android.com/reference/java/nio/file/Path#toFile()` method is useful to construct a `File` from the `String` representation of a `Path`.

## Concurrency

Implementations of this interface are immutable and safe for use by
multiple concurrent threads.

## Summary

| ### Public methods ||
|---|---|
| ` abstract int` | ` https://developer.android.com/reference/java/nio/file/Path#compareTo(java.nio.file.Path)(https://developer.android.com/reference/java/nio/file/Path other) ` Compares two abstract paths lexicographically. |
| ` abstract boolean` | ` https://developer.android.com/reference/java/nio/file/Path#endsWith(java.lang.String)(https://developer.android.com/reference/java/lang/String other) ` Tests if this path ends with a `Path`, constructed by converting the given path string, in exactly the manner specified by the `https://developer.android.com/reference/java/nio/file/Path#endsWith(java.nio.file.Path)` method. |
| ` abstract boolean` | ` https://developer.android.com/reference/java/nio/file/Path#endsWith(java.nio.file.Path)(https://developer.android.com/reference/java/nio/file/Path other) ` Tests if this path ends with the given path. |
| ` abstract boolean` | ` https://developer.android.com/reference/java/nio/file/Path#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object other) ` Tests this path for equality with the given object. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#getFileName()() ` Returns the name of the file or directory denoted by this path as a `Path` object. |
| ` abstract https://developer.android.com/reference/java/nio/file/FileSystem` | ` https://developer.android.com/reference/java/nio/file/Path#getFileSystem()() ` Returns the file system that created this object. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#getName(int)(int index) ` Returns a name element of this path as a `Path` object. |
| ` abstract int` | ` https://developer.android.com/reference/java/nio/file/Path#getNameCount()() ` Returns the number of name elements in the path. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#getParent()() ` Returns the *parent path* , or `null` if this path does not have a parent. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#getRoot()() ` Returns the root component of this path as a `Path` object, or `null` if this path does not have a root component. |
| ` abstract int` | ` https://developer.android.com/reference/java/nio/file/Path#hashCode()() ` Computes a hash code for this path. |
| ` abstract boolean` | ` https://developer.android.com/reference/java/nio/file/Path#isAbsolute()() ` Tells whether or not this path is absolute. |
| ` abstract https://developer.android.com/reference/java/util/Iterator<https://developer.android.com/reference/java/nio/file/Path>` | ` https://developer.android.com/reference/java/nio/file/Path#iterator()() ` Returns an iterator over the name elements of this path. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#normalize()() ` Returns a path that is this path with redundant name elements eliminated. |
| ` static https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#of(java.lang.String,%20java.lang.String[])(https://developer.android.com/reference/java/lang/String first, https://developer.android.com/reference/java/lang/String more) ` Returns a `Path` by converting a path string, or a sequence of strings that when joined form a path string. |
| ` static https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#of(java.net.URI)(https://developer.android.com/reference/java/net/URI uri) ` Returns a `Path` by converting a URI. |
| ` abstract https://developer.android.com/reference/java/nio/file/WatchKey` | ` https://developer.android.com/reference/java/nio/file/Path#register(java.nio.file.WatchService,%20java.nio.file.WatchEvent.Kind<?>[],%20java.nio.file.WatchEvent.Modifier[])(https://developer.android.com/reference/java/nio/file/WatchService watcher, https://developer.android.com/reference/java/nio/file/WatchEvent.Kind<?> events, https://developer.android.com/reference/java/nio/file/WatchEvent.Modifier modifiers) ` Registers the file located by this path with a watch service. |
| ` abstract https://developer.android.com/reference/java/nio/file/WatchKey` | ` https://developer.android.com/reference/java/nio/file/Path#register(java.nio.file.WatchService,%20java.nio.file.WatchEvent.Kind<?>[])(https://developer.android.com/reference/java/nio/file/WatchService watcher, https://developer.android.com/reference/java/nio/file/WatchEvent.Kind<?> events) ` Registers the file located by this path with a watch service. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#relativize(java.nio.file.Path)(https://developer.android.com/reference/java/nio/file/Path other) ` Constructs a relative path between this path and a given path. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#resolve(java.nio.file.Path)(https://developer.android.com/reference/java/nio/file/Path other) ` Resolve the given path against this path. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#resolve(java.lang.String)(https://developer.android.com/reference/java/lang/String other) ` Converts a given path string to a `Path` and resolves it against this `Path` in exactly the manner specified by the `https://developer.android.com/reference/java/nio/file/Path#resolve(java.nio.file.Path)` method. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#resolveSibling(java.lang.String)(https://developer.android.com/reference/java/lang/String other) ` Converts a given path string to a `Path` and resolves it against this path's `https://developer.android.com/reference/java/nio/file/Path#getParent()` path in exactly the manner specified by the `https://developer.android.com/reference/java/nio/file/Path#resolveSibling(java.nio.file.Path)` method. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#resolveSibling(java.nio.file.Path)(https://developer.android.com/reference/java/nio/file/Path other) ` Resolves the given path against this path's `https://developer.android.com/reference/java/nio/file/Path#getParent()` path. |
| ` abstract boolean` | ` https://developer.android.com/reference/java/nio/file/Path#startsWith(java.nio.file.Path)(https://developer.android.com/reference/java/nio/file/Path other) ` Tests if this path starts with the given path. |
| ` abstract boolean` | ` https://developer.android.com/reference/java/nio/file/Path#startsWith(java.lang.String)(https://developer.android.com/reference/java/lang/String other) ` Tests if this path starts with a `Path`, constructed by converting the given path string, in exactly the manner specified by the `https://developer.android.com/reference/java/nio/file/Path#startsWith(java.nio.file.Path)` method. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#subpath(int,%20int)(int beginIndex, int endIndex) ` Returns a relative `Path` that is a subsequence of the name elements of this path. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#toAbsolutePath()() ` Returns a `Path` object representing the absolute path of this path. |
| ` abstract https://developer.android.com/reference/java/io/File` | ` https://developer.android.com/reference/java/nio/file/Path#toFile()() ` Returns a `https://developer.android.com/reference/java/io/File` object representing this path. |
| ` abstract https://developer.android.com/reference/java/nio/file/Path` | ` https://developer.android.com/reference/java/nio/file/Path#toRealPath(java.nio.file.LinkOption[])(https://developer.android.com/reference/java/nio/file/LinkOption options) ` Returns the *real* path of an existing file. |
| ` abstract https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/nio/file/Path#toString()() ` Returns the string representation of this path. |
| ` abstract https://developer.android.com/reference/java/net/URI` | ` https://developer.android.com/reference/java/nio/file/Path#toUri()() ` Returns a URI to represent this path. |

| ### Inherited methods |
|---|---|
| From interface ` https://developer.android.com/reference/java/lang/Comparable ` |---|---| | ` abstract int` | ` https://developer.android.com/reference/java/lang/Comparable#compareTo(T)(https://developer.android.com/reference/java/nio/file/Path o) ` Compares this object with the specified object for order. | ||
| From interface ` https://developer.android.com/reference/java/lang/Iterable ` |---|---| | ` default void` | ` https://developer.android.com/reference/java/lang/Iterable#forEach(java.util.function.Consumer<?%20super%20T>)(https://developer.android.com/reference/java/util/function/Consumer<? super T> action) ` Performs the given action for each element of the `Iterable` until all elements have been processed or the action throws an exception. | | ` abstract https://developer.android.com/reference/java/util/Iterator<https://developer.android.com/reference/java/nio/file/Path>` | ` https://developer.android.com/reference/java/lang/Iterable#iterator()() ` Returns an iterator over elements of type `T`. | | ` default https://developer.android.com/reference/java/util/Spliterator<https://developer.android.com/reference/java/nio/file/Path>` | ` https://developer.android.com/reference/java/lang/Iterable#spliterator()() ` Creates a `https://developer.android.com/reference/java/util/Spliterator` over the elements described by this `Iterable`. | ||
| From interface ` https://developer.android.com/reference/java/nio/file/Watchable ` |---|---| | ` abstract https://developer.android.com/reference/java/nio/file/WatchKey` | ` https://developer.android.com/reference/java/nio/file/Watchable#register(java.nio.file.WatchService,%20java.nio.file.WatchEvent.Kind<?>[],%20java.nio.file.WatchEvent.Modifier[])(https://developer.android.com/reference/java/nio/file/WatchService watcher, https://developer.android.com/reference/java/nio/file/WatchEvent.Kind<?> events, https://developer.android.com/reference/java/nio/file/WatchEvent.Modifier modifiers) ` Registers an object with a watch service. | | ` abstract https://developer.android.com/reference/java/nio/file/WatchKey` | ` https://developer.android.com/reference/java/nio/file/Watchable#register(java.nio.file.WatchService,%20java.nio.file.WatchEvent.Kind<?>[])(https://developer.android.com/reference/java/nio/file/WatchService watcher, https://developer.android.com/reference/java/nio/file/WatchEvent.Kind<?> events) ` Registers an object with a watch service. | ||

## Public methods

### compareTo

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract int compareTo (Path other)
```

Compares two abstract paths lexicographically. The ordering defined by
this method is provider specific, and in the case of the default
provider, platform specific. This method does not access the file system
and neither file is required to exist.

This method may not be used to compare paths that are associated
with different file system providers.

<br />

| Parameters ||
|---|---|
| `other` | `Path`: the path compared to this path. <br /> |

| Returns ||
|---|---|
| `int` | zero if the argument is `https://developer.android.com/reference/java/nio/file/Path#equals(java.lang.Object)` to this path, a value less than zero if this path is lexicographically less than the argument, or a value greater than zero if this path is lexicographically greater than the argument <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/ClassCastException` | if the paths are associated with different providers |

### endsWith

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract boolean endsWith (String other)
```

Tests if this path ends with a `Path`, constructed by converting
the given path string, in exactly the manner specified by the `https://developer.android.com/reference/java/nio/file/Path#endsWith(java.nio.file.Path)` method. On UNIX for example, the path
"`foo/bar`" ends with "`foo/bar`" and "`bar`". It does
not end with "`r`" or "`/bar`". Note that trailing separators
are not taken into account, and so invoking this method on the `Path`"`foo/bar`" with the `String` "`bar/`" returns
`true`.

<br />

| Parameters ||
|---|---|
| `other` | `String`: the given path string <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this path ends with the given path; otherwise `false` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/InvalidPathException` | If the path string cannot be converted to a Path. |

### endsWith

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract boolean endsWith (Path other)
```

Tests if this path ends with the given path.

If the given path has *N* elements, and no root component,
and this path has *N* or more elements, then this path ends with
the given path if the last *N* elements of each path, starting at
the element farthest from the root, are equal.

If the given path has a root component then this path ends with the
given path if the root component of this path *ends with* the root
component of the given path, and the corresponding elements of both paths
are equal. Whether or not the root component of this path ends with the
root component of the given path is file system specific. If this path
does not have a root component and the given path has a root component
then this path does not end with the given path.

If the given path is associated with a different `FileSystem`
to this path then `false` is returned.

<br />

| Parameters ||
|---|---|
| `other` | `Path`: the given path <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this path ends with the given path; otherwise `false` <br /> |

### equals

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract boolean equals (Object other)
```

Tests this path for equality with the given object.

If the given object is not a Path, or is a Path associated with a
different `FileSystem`, then this method returns `false`.

Whether or not two path are equal depends on the file system
implementation. In some cases the paths are compared without regard
to case, and others are case sensitive. This method does not access the
file system and the file is not required to exist. Where required, the
`https://developer.android.com/reference/java/nio/file/Files#isSameFile(java.nio.file.Path,%20java.nio.file.Path)` method may be used to check if two
paths locate the same file.

This method satisfies the general contract of the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method.

<br />

<br />

| Parameters ||
|---|---|
| `other` | `Object`: the object to which this object is to be compared <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if, and only if, the given object is a `Path` that is identical to this `Path` <br /> |

### getFileName

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path getFileName ()
```

Returns the name of the file or directory denoted by this path as a
`Path` object. The file name is the *farthest* element from
the root in the directory hierarchy.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | a path representing the name of the file or directory, or `null` if this path has zero elements <br /> |

### getFileSystem

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract FileSystem getFileSystem ()
```

Returns the file system that created this object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/FileSystem` | the file system that created this object <br /> |

### getName

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path getName (int index)
```

Returns a name element of this path as a `Path` object.

The `index` parameter is the index of the name element to return.
The element that is *closest* to the root in the directory hierarchy
has index `0`. The element that is *farthest* from the root
has index `https://developer.android.com/reference/java/nio/file/Path#getNameCount()``-1`.

<br />

| Parameters ||
|---|---|
| `index` | `int`: the index of the element <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | the name element <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `index` is negative, `index` is greater than or equal to the number of elements, or this path has zero name elements |

### getNameCount

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract int getNameCount ()
```

Returns the number of name elements in the path.

<br />

| Returns ||
|---|---|
| `int` | the number of elements in the path, or `0` if this path only represents a root component <br /> |

### getParent

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path getParent ()
```

Returns the *parent path* , or `null` if this path does not
have a parent.

The parent of this path object consists of this path's root
component, if any, and each element in the path except for the
*farthest* from the root in the directory hierarchy. This method
does not access the file system; the path or its parent may not exist.
Furthermore, this method does not eliminate special names such as "."
and ".." that may be used in some implementations. On UNIX for example,
the parent of "`/a/b/c`" is "`/a/b`", and the parent of
`"x/y/.`" is "`x/y`". This method may be used with the `https://developer.android.com/reference/java/nio/file/Path#normalize()` method, to eliminate redundant names, for cases where
*shell-like* navigation is required.

If this path has one or more elements, and no root component, then
this method is equivalent to evaluating the expression:
>
> ```
> subpath(0, getNameCount()-1);
> ```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | a path representing the path's parent <br /> |

### getRoot

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path getRoot ()
```

Returns the root component of this path as a `Path` object,
or `null` if this path does not have a root component.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | a path representing the root component of this path, or `null` <br /> |

### hashCode

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract int hashCode ()
```

Computes a hash code for this path.

The hash code is based upon the components of the path, and
satisfies the general contract of the `https://developer.android.com/reference/java/lang/Object#hashCode()` method.

<br />

| Returns ||
|---|---|
| `int` | the hash-code value for this path <br /> |

### isAbsolute

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract boolean isAbsolute ()
```

Tells whether or not this path is absolute.

An absolute path is complete in that it doesn't need to be combined
with other path information in order to locate a file.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if, and only if, this path is absolute <br /> |

### iterator

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Iterator<Path> iterator ()
```

Returns an iterator over the name elements of this path.

The first element returned by the iterator represents the name
element that is closest to the root in the directory hierarchy, the
second element is the next closest, and so on. The last element returned
is the name of the file or directory denoted by this path. The `https://developer.android.com/reference/java/nio/file/Path#getRoot()` component, if present, is not returned by the iterator.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Iterator<https://developer.android.com/reference/java/nio/file/Path>` | an iterator over the name elements of this path. <br /> |

### normalize

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path normalize ()
```

Returns a path that is this path with redundant name elements eliminated.

The precise definition of this method is implementation dependent but
in general it derives from this path, a path that does not contain
*redundant* name elements. In many file systems, the "`.`"
and "`..`" are special names used to indicate the current directory
and parent directory. In such file systems all occurrences of "`.`"
are considered redundant. If a "`..`" is preceded by a
non-"`..`" name then both names are considered redundant (the
process to identify such names is repeated until it is no longer
applicable).

This method does not access the file system; the path may not locate
a file that exists. Eliminating "`..`" and a preceding name from a
path may result in the path that locates a different file than the original
path. This can arise when the preceding name is a symbolic link.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | the resulting path or this path if it does not contain redundant name elements; an empty path is returned if this path does have a root component and all name elements are redundant <br /> |

**See also:**

- `https://developer.android.com/reference/java/nio/file/Path#getParent()`
- `https://developer.android.com/reference/java/nio/file/Path#toRealPath(java.nio.file.LinkOption[])`

### of

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Path of (String first, 
                String... more)
```

Returns a `Path` by converting a path string, or a sequence of
strings that when joined form a path string. If `more` does not
specify any elements then the value of the `first` parameter is
the path string to convert. If `more` specifies one or more
elements then each non-empty string, including `first`, is
considered to be a sequence of name elements and is joined to form a
path string. The details as to how the Strings are joined is provider
specific but typically they will be joined using the
`https://developer.android.com/reference/java/nio/file/FileSystem#getSeparator()` as the separator.
For example, if the name separator is "`/`" and
`getPath("/foo","bar","gus")` is invoked, then the path string
`"/foo/bar/gus"` is converted to a `Path`. A `Path`
representing an empty path is returned if `first` is the empty
string and `more` does not contain any non-empty strings.

The `Path` is obtained by invoking the `https://developer.android.com/reference/java/nio/file/FileSystem#getPath(java.lang.String,%20java.lang.String[])` method of the `https://developer.android.com/reference/java/nio/file/FileSystems#getDefault()` `https://developer.android.com/reference/java/nio/file/FileSystem`.

Note that while this method is very convenient, using it will imply
an assumed reference to the default `FileSystem` and limit the
utility of the calling code. Hence it should not be used in library code
intended for flexible reuse. A more flexible alternative is to use an
existing `Path` instance as an anchor, such as:

    Path dir = ...
        Path path = dir.resolve("file");

<br />

<br />

| Parameters ||
|---|---|
| `first` | `String`: the path string or initial part of the path string <br /> |
| `more` | `String`: additional strings to be joined to form the path string <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | the resulting `Path` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/InvalidPathException` | if the path string cannot be converted to a `Path` |

**See also:**

- `https://developer.android.com/reference/java/nio/file/FileSystem#getPath(java.lang.String,%20java.lang.String[])`

### of

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Path of (URI uri)
```

Returns a `Path` by converting a URI.

This method iterates over the `https://developer.android.com/reference/java/nio/file/spi/FileSystemProvider#installedProviders()` providers to locate the provider that is identified by the
URI `https://developer.android.com/reference/java/net/URI#getScheme()` of the given URI. URI schemes are
compared without regard to case. If the provider is found then its `https://developer.android.com/reference/java/nio/file/spi/FileSystemProvider#getPath(java.net.URI)` method is invoked to convert the
URI.

In the case of the default provider, identified by the URI scheme
"file", the given URI has a non-empty path component, and undefined query
and fragment components. Whether the authority component may be present
is platform specific. The returned `Path` is associated with the
`https://developer.android.com/reference/java/nio/file/FileSystems#getDefault()` file system.

The default provider provides a similar *round-trip* guarantee
to the `https://developer.android.com/reference/java/io/File` class. For a given `Path` *p* it
is guaranteed that
> `Path.of(`*p*`.``https://developer.android.com/reference/java/nio/file/Path#toUri()``()).equals(` *p*`.``https://developer.android.com/reference/java/nio/file/Path#toAbsolutePath()``())`
so long as the original `Path`, the `URI`, and the new `Path` are all created in (possibly different invocations of) the same Java virtual machine. Whether other providers make any guarantees is provider specific and therefore unspecified.

<br />

<br />

| Parameters ||
|---|---|
| `uri` | `URI`: the URI to convert <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | the resulting `Path` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if preconditions on the `uri` parameter do not hold. The format of the URI is provider specific. |
| `https://developer.android.com/reference/java/lang/SecurityException` | if a security manager is installed and it denies an unspecified permission to access the file system |
| `https://developer.android.com/reference/java/nio/file/FileSystemNotFoundException` | The file system, identified by the URI, does not exist and cannot be created automatically, or the provider identified by the URI's scheme component is not installed |

### register

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract WatchKey register (WatchService watcher, 
                Kind[]<?> events, 
                Modifier... modifiers)
```

Registers the file located by this path with a watch service.

In this release, this path locates a directory that exists. The
directory is registered with the watch service so that entries in the
directory can be watched. The `events` parameter is the events to
register and may contain the following events:

- `https://developer.android.com/reference/java/nio/file/StandardWatchEventKinds#ENTRY_CREATE` - entry created or moved into the directory
- `https://developer.android.com/reference/java/nio/file/StandardWatchEventKinds#ENTRY_DELETE` - entry deleted or moved out of the directory
- `https://developer.android.com/reference/java/nio/file/StandardWatchEventKinds#ENTRY_MODIFY` - entry in directory was modified

The `https://developer.android.com/reference/java/nio/file/WatchEvent#context()` for these events is the
relative path between the directory located by this path, and the path
that locates the directory entry that is created, deleted, or modified.

The set of events may include additional implementation specific
event that are not defined by the enum `https://developer.android.com/reference/java/nio/file/StandardWatchEventKinds`

The `modifiers` parameter specifies *modifiers* that
qualify how the directory is registered. This release does not define any
*standard* modifiers. It may contain implementation specific
modifiers.

Where a file is registered with a watch service by means of a symbolic
link then it is implementation specific if the watch continues to depend
on the existence of the symbolic link after it is registered.

<br />

| Parameters ||
|---|---|
| `watcher` | `WatchService`: the watch service to which this object is to be registered <br /> |
| `events` | `Kind`: the events for which this object should be registered <br /> |
| `modifiers` | `Modifier`: the modifiers, if any, that modify how the object is registered <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/WatchKey` | a key representing the registration of this object with the given watch service <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` | if an I/O error occurs |
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if an invalid combination of events or modifiers is specified |
| `https://developer.android.com/reference/java/lang/SecurityException` | In the case of the default provider, and a security manager is installed, the `https://developer.android.com/reference/java/lang/SecurityManager#checkRead(java.lang.String)` method is invoked to check read access to the file. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | if unsupported events or modifiers are specified |
| `https://developer.android.com/reference/java/nio/file/ClosedWatchServiceException` | if the watch service is closed |
| `https://developer.android.com/reference/java/nio/file/NotDirectoryException` | if the file is registered to watch the entries in a directory and the file is not a directory *(optional specific exception)* |

### register

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract WatchKey register (WatchService watcher, 
                Kind...<?> events)
```

Registers the file located by this path with a watch service.

An invocation of this method behaves in exactly the same way as the
invocation

        watchable.https://developer.android.com/reference/java/nio/file/Path#register(java.nio.file.WatchService,%20java.nio.file.WatchEvent.Kind<?>[],%20java.nio.file.WatchEvent.Modifier[])(watcher, events, new WatchEvent.Modifier[0]);

**Usage Example:**
Suppose we wish to register a directory for entry create, delete, and modify
events:

```
    Path dir = ...
    WatchService watcher = ...

    WatchKey key = dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY);
```

<br />

<br />

| Parameters ||
|---|---|
| `watcher` | `WatchService`: The watch service to which this object is to be registered <br /> |
| `events` | `Kind`: The events for which this object should be registered <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/WatchKey` | A key representing the registration of this object with the given watch service <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` | If an I/O error occurs |
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If an invalid combination of events is specified |
| `https://developer.android.com/reference/java/lang/SecurityException` | In the case of the default provider, and a security manager is installed, the `https://developer.android.com/reference/java/lang/SecurityManager#checkRead(java.lang.String)` method is invoked to check read access to the file. |
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | If unsupported events are specified |
| `https://developer.android.com/reference/java/nio/file/ClosedWatchServiceException` | If the watch service is closed |
| `https://developer.android.com/reference/java/nio/file/NotDirectoryException` | If the file is registered to watch the entries in a directory and the file is not a directory *(optional specific exception)* |

### relativize

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path relativize (Path other)
```

Constructs a relative path between this path and a given path.

Relativization is the inverse of `https://developer.android.com/reference/java/nio/file/Path#resolve(java.nio.file.Path)`.
This method attempts to construct a `https://developer.android.com/reference/java/nio/file/Path#isAbsolute()` path
that when `https://developer.android.com/reference/java/nio/file/Path#resolve(java.nio.file.Path)` against this path, yields a
path that locates the same file as the given path. For example, on UNIX,
if this path is `"/a/b"` and the given path is `"/a/b/c/d"`
then the resulting relative path would be `"c/d"`. Where this
path and the given path do not have a `https://developer.android.com/reference/java/nio/file/Path#getRoot()` component,
then a relative path can be constructed. A relative path cannot be
constructed if only one of the paths have a root component. Where both
paths have a root component then it is implementation dependent if a
relative path can be constructed. If this path and the given path are
`https://developer.android.com/reference/java/nio/file/Path#equals(java.lang.Object)` then an *empty path* is returned.

For any two `https://developer.android.com/reference/java/nio/file/Path#normalize()` paths *p* and
*q*, where *q* does not have a root component,
> *p*.relativize(*p*.resolve(*q*)).equals(*q*)

When symbolic links are supported, then whether the resulting path,
when resolved against this path, yields a path that can be used to locate
the `https://developer.android.com/reference/java/nio/file/Files#isSameFile(java.nio.file.Path,%20java.nio.file.Path)` file as `other` is implementation
dependent. For example, if this path is `"/a/b"` and the given
path is `"/a/x"` then the resulting relative path may be `"../x"`. If `"b"` is a symbolic link then is implementation
dependent if `"a/b/../x"` would locate the same file as `"/a/x"`.

<br />

| Parameters ||
|---|---|
| `other` | `Path`: the path to relativize against this path <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | the resulting relative path, or an empty path if both paths are equal <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `other` is not a `Path` that can be relativized against this path |

### resolve

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path resolve (Path other)
```

Resolve the given path against this path.

If the `other` parameter is an `https://developer.android.com/reference/java/nio/file/Path#isAbsolute()`
path then this method trivially returns `other`. If `other`
is an *empty path* then this method trivially returns this path.
Otherwise this method considers this path to be a directory and resolves
the given path against this path. In the simplest case, the given path
does not have a `https://developer.android.com/reference/java/nio/file/Path#getRoot()` component, in which case this method
*joins* the given path to this path and returns a resulting path
that `https://developer.android.com/reference/java/nio/file/Path#endsWith(java.lang.String)` with the given path. Where the given path has
a root component then resolution is highly implementation dependent and
therefore unspecified.

<br />

| Parameters ||
|---|---|
| `other` | `Path`: the path to resolve against this path <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | the resulting path <br /> |

**See also:**

- `https://developer.android.com/reference/java/nio/file/Path#relativize(java.nio.file.Path)`

### resolve

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path resolve (String other)
```

Converts a given path string to a `Path` and resolves it against
this `Path` in exactly the manner specified by the `https://developer.android.com/reference/java/nio/file/Path#resolve(java.nio.file.Path)` method. For example, suppose that the name
separator is "`/`" and a path represents "`foo/bar`", then
invoking this method with the path string "`gus`" will result in
the `Path` "`foo/bar/gus`".

<br />

| Parameters ||
|---|---|
| `other` | `String`: the path string to resolve against this path <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | the resulting path <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/InvalidPathException` | if the path string cannot be converted to a Path. |

**See also:**

- `https://developer.android.com/reference/java/nio/file/FileSystem#getPath(java.lang.String,%20java.lang.String[])`

### resolveSibling

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path resolveSibling (String other)
```

Converts a given path string to a `Path` and resolves it against
this path's `https://developer.android.com/reference/java/nio/file/Path#getParent()` path in exactly the manner
specified by the `https://developer.android.com/reference/java/nio/file/Path#resolveSibling(java.nio.file.Path)` method.

<br />

| Parameters ||
|---|---|
| `other` | `String`: the path string to resolve against this path's parent <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | the resulting path <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/InvalidPathException` | if the path string cannot be converted to a Path. |

**See also:**

- `https://developer.android.com/reference/java/nio/file/FileSystem#getPath(java.lang.String,%20java.lang.String[])`

### resolveSibling

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path resolveSibling (Path other)
```

Resolves the given path against this path's `https://developer.android.com/reference/java/nio/file/Path#getParent()`
path. This is useful where a file name needs to be *replaced* with
another file name. For example, suppose that the name separator is
"`/`" and a path represents "`dir1/dir2/foo`", then invoking
this method with the `Path` "`bar`" will result in the `Path` "`dir1/dir2/bar`". If this path does not have a parent path,
or `other` is `https://developer.android.com/reference/java/nio/file/Path#isAbsolute()`, then this method
returns `other`. If `other` is an empty path then this method
returns this path's parent, or where this path doesn't have a parent, the
empty path.

<br />

| Parameters ||
|---|---|
| `other` | `Path`: the path to resolve against this path's parent <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | the resulting path <br /> |

**See also:**

- `https://developer.android.com/reference/java/nio/file/Path#resolve(java.nio.file.Path)`

### startsWith

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract boolean startsWith (Path other)
```

Tests if this path starts with the given path.

This path *starts* with the given path if this path's root
component *starts* with the root component of the given path,
and this path starts with the same name elements as the given path.
If the given path has more name elements than this path then `false`
is returned.

Whether or not the root component of this path starts with the root
component of the given path is file system specific. If this path does
not have a root component and the given path has a root component then
this path does not start with the given path.

If the given path is associated with a different `FileSystem`
to this path then `false` is returned.

<br />

| Parameters ||
|---|---|
| `other` | `Path`: the given path <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this path starts with the given path; otherwise `false` <br /> |

### startsWith

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract boolean startsWith (String other)
```

Tests if this path starts with a `Path`, constructed by converting
the given path string, in exactly the manner specified by the `https://developer.android.com/reference/java/nio/file/Path#startsWith(java.nio.file.Path)` method. On UNIX for example, the path
"`foo/bar`" starts with "`foo`" and "`foo/bar`". It
does not start with "`f`" or "`fo`".

<br />

| Parameters ||
|---|---|
| `other` | `String`: the given path string <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this path starts with the given path; otherwise `false` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/InvalidPathException` | If the path string cannot be converted to a Path. |

### subpath

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path subpath (int beginIndex, 
                int endIndex)
```

Returns a relative `Path` that is a subsequence of the name
elements of this path.

The `beginIndex` and `endIndex` parameters specify the
subsequence of name elements. The name that is *closest* to the root
in the directory hierarchy has index `0`. The name that is
*farthest* from the root has index `https://developer.android.com/reference/java/nio/file/Path#getNameCount()``-1`. The returned `Path` object has the name elements
that begin at `beginIndex` and extend to the element at index `endIndex-1`.

<br />

| Parameters ||
|---|---|
| `beginIndex` | `int`: the index of the first element, inclusive <br /> |
| `endIndex` | `int`: the index of the last element, exclusive <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | a new `Path` object that is a subsequence of the name elements in this `Path` <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `beginIndex` is negative, or greater than or equal to the number of elements. If `endIndex` is less than or equal to `beginIndex`, or larger than the number of elements. |

### toAbsolutePath

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path toAbsolutePath ()
```

Returns a `Path` object representing the absolute path of this
path.

If this path is already `https://developer.android.com/reference/java/nio/file/Path#isAbsolute()` then this
method simply returns this path. Otherwise, this method resolves the path
in an implementation dependent manner, typically by resolving the path
against a file system default directory. Depending on the implementation,
this method may throw an I/O error if the file system is not accessible.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | a `Path` object representing the absolute path <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOError` | if an I/O error occurs |
| `https://developer.android.com/reference/java/lang/SecurityException` | In the case of the default provider, a security manager is installed, and this path is not absolute, then the security manager's `https://developer.android.com/reference/java/lang/SecurityManager#checkPropertyAccess(java.lang.String)` method is invoked to check access to the system property `user.dir` |

### toFile

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract File toFile ()
```

Returns a `https://developer.android.com/reference/java/io/File` object representing this path. Where this `Path` is associated with the default provider, then this method is
equivalent to returning a `File` object constructed with the
`String` representation of this path.

If this path was created by invoking the `File` `https://developer.android.com/reference/java/io/File#toPath()` method then there is no guarantee that the `File` object returned by this method is `https://developer.android.com/reference/java/nio/file/Path#equals(java.lang.Object)` to the
original `File`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/io/File` | a `File` object representing this path <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | if this `Path` is not associated with the default provider |

### toRealPath

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract Path toRealPath (LinkOption... options)
```

Returns the *real* path of an existing file.

The precise definition of this method is implementation dependent but
in general it derives from this path, an `https://developer.android.com/reference/java/nio/file/Path#isAbsolute()`
path that locates the `https://developer.android.com/reference/java/nio/file/Files#isSameFile(java.nio.file.Path,%20java.nio.file.Path)` file as this path, but
with name elements that represent the actual name of the directories
and the file. For example, where filename comparisons on a file system
are case insensitive then the name elements represent the names in their
actual case. Additionally, the resulting path has redundant name
elements removed.

If this path is relative then its absolute path is first obtained,
as if by invoking the `https://developer.android.com/reference/java/nio/file/Path#toAbsolutePath()` method.

The `options` array may be used to indicate how symbolic links
are handled. By default, symbolic links are resolved to their final
target. If the option `https://developer.android.com/reference/java/nio/file/LinkOption#NOFOLLOW_LINKS` is
present then this method does not resolve symbolic links.

Some implementations allow special names such as "`..`" to refer to
the parent directory. When deriving the *real path* , and a
"`..`" (or equivalent) is preceded by a non-"`..`" name then
an implementation will typically cause both names to be removed. When
not resolving symbolic links and the preceding name is a symbolic link
then the names are only removed if it guaranteed that the resulting path
will locate the same file as this path.

<br />

| Parameters ||
|---|---|
| `options` | `LinkOption`: options indicating how symbolic links are handled <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/nio/file/Path` | an absolute path represent the *real* path of the file located by this object <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` | if the file does not exist or an I/O error occurs |
| `https://developer.android.com/reference/java/lang/SecurityException` | In the case of the default provider, and a security manager is installed, its `https://developer.android.com/reference/java/lang/SecurityManager#checkRead(java.lang.String)` method is invoked to check read access to the file, and where this path is not absolute, its `https://developer.android.com/reference/java/lang/SecurityManager#checkPropertyAccess(java.lang.String)` method is invoked to check access to the system property `user.dir` |

### toString

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract String toString ()
```

Returns the string representation of this path.

If this path was created by converting a path string using the
`https://developer.android.com/reference/java/nio/file/FileSystem#getPath(java.lang.String,%20java.lang.String[])` method then the path string returned
by this method may differ from the original String used to create the path.

The returned path string uses the default name `https://developer.android.com/reference/java/nio/file/FileSystem#getSeparator()` to separate names in the path.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the string representation of this path <br /> |

### toUri

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract URI toUri ()
```

Returns a URI to represent this path.

This method constructs an absolute `https://developer.android.com/reference/java/net/URI` with a `https://developer.android.com/reference/java/net/URI#getScheme()` equal to the URI scheme that identifies the
provider. The exact form of the scheme specific part is highly provider
dependent.

In the case of the default provider, the URI is hierarchical with
a `https://developer.android.com/reference/java/net/URI#getPath()` 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
the `URI` may be used to construct a `https://developer.android.com/reference/java/io/File`.
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
resulting `URI` will end with a slash.

The default provider provides a similar *round-trip* guarantee
to the `https://developer.android.com/reference/java/io/File` class. For a given `Path` *p* it
is guaranteed that
> `https://developer.android.com/reference/java/nio/file/Paths#get(java.net.URI)`(*p*.toUri()).equals(*p* .`https://developer.android.com/reference/java/nio/file/Path#toAbsolutePath()`())
so long as the original `Path`, the `URI`, and the new `Path` are 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.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/net/URI` | the URI representing this path <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOError` | 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 |
| `https://developer.android.com/reference/java/lang/SecurityException` | In the case of the default provider, and a security manager is installed, the `https://developer.android.com/reference/java/nio/file/Path#toAbsolutePath()` method throws a security exception. |