APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.jrtfs

pack-priv final Class JrtPath

extends Object
implements Path
Class Inheritance
All Implemented Interfaces
java.nio.file.Path, java.nio.file.Watchable, java.lang.Iterable, java.lang.Comparable
Imports
java.io.File, .IOError, .IOException, .InputStream, .OutputStream, java.net.URI, .URISyntaxException, java.nio.channels.FileChannel, .SeekableByteChannel, java.nio.file.*, .DirectoryStream.Filter, java.nio.file.attribute.BasicFileAttributes, .BasicFileAttributeView, .FileAttribute, .FileTime, java.util.Iterator, .Map, .NoSuchElementException, .Objects, .Set

Base class for Path implementation of jrt file systems.

Implementation Note

This class needs to maintain JDK 8 source compatibility. It is used internally in the JDK to implement jimage/jrtfs access, but also compiled and delivered as part of the jrtfs.jar to support access to the jimage file provided by the shipped JDK by tools running on JDK 8.

Field Summary

Modifier and TypeField and Description
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final char[]
pack-priv final JrtFileSystem
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private static final long
private volatile int[]
private final String
private volatile String

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
JrtPath(JrtFileSystem jrtfs, String path, boolean normalized)

Method Summary

Modifier and TypeMethod and Description
pack-priv final void
private JrtPath
public final int
compareTo(Path other)

Implements java.nio.file.Path.compareTo.

Compares two abstract paths lexicographically.

pack-priv final void
copy(JrtPath target, CopyOption... options)

private void
copyToTarget(JrtPath target, CopyOption... options)

pack-priv final void
pack-priv final void
pack-priv final void
public final boolean
endsWith(Path other)

Implements java.nio.file.Path.endsWith.

Tests if this path ends with the given path.

public final boolean
endsWith(String other)

Overrides default java.nio.file.Path.endsWith.

Tests if this path ends with a Path, constructed by converting the given path string, in exactly the manner specified by the endsWith(Path) method.

public final boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Implements java.nio.file.Path.equals.

Tests this path for equality with the given object.

private boolean
equalsNameAt(JrtPath other, int index)

pack-priv final boolean
pack-priv final JrtFileAttributes
public final JrtPath
getFileName()

Implements java.nio.file.Path.getFileName.

Returns the name of the file or directory denoted by this path as a Path object.

pack-priv final FileStore
public JrtFileSystem
getFileSystem()

Implements java.nio.file.Path.getFileSystem.

Returns the file system that created this object.

pack-priv final String
public final JrtPath
getName(int index)

Implements java.nio.file.Path.getName.

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

public final int
getNameCount()

Implements java.nio.file.Path.getNameCount.

Returns the number of name elements in the path.

public final JrtPath
getParent()

Implements java.nio.file.Path.getParent.

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

private String
pack-priv final String
public final JrtPath
getRoot()

Implements 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.

public final int
hashCode()

Overrides java.lang.Object.hashCode.

Implements java.nio.file.Path.hashCode.

Computes a hash code for this path.

private static long
private static long
highMask(char first, char last)

private void
public final boolean
isAbsolute()

Implements java.nio.file.Path.isAbsolute.

Tells whether or not this path is absolute.

pack-priv final boolean
pack-priv final boolean
public final Iterator<Path>
iterator()

Overrides default java.nio.file.Path.iterator.

Returns an iterator over the name elements of this path.

private static long
lowMask(String chars)

private static long
lowMask(char first, char last)

private static boolean
match(char c, long lowMask, long highMask)

pack-priv final void
move(JrtPath target, CopyOption... options)

pack-priv final SeekableByteChannel
newByteChannel(Set<? extends OpenOption> options, FileAttribute<?>... attrs)

pack-priv final DirectoryStream<Path>
pack-priv final FileChannel
newFileChannel(Set<? extends OpenOption> options, FileAttribute<?>... attrs)

pack-priv final InputStream
pack-priv final OutputStream
public final JrtPath
normalize()

Implements java.nio.file.Path.normalize.

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

private static String
private static String
normalize(String path, int off)

pack-priv final Map<String, Object>
readAttributes(String attributes, LinkOption... options)

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

Implements java.nio.file.Path.register.

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

public final WatchKey
register(WatchService watcher, WatchEvent.Kind<?>... events)

Overrides default java.nio.file.Path.register.

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

public final JrtPath
relativize(Path other)

Implements java.nio.file.Path.relativize.

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

public final JrtPath
resolve(Path other)

Implements java.nio.file.Path.resolve.

Resolve the given path against this path.

public final JrtPath
resolve(String other)

Overrides default java.nio.file.Path.resolve.

Converts a given path string to a Path and resolves it against this Path in exactly the manner specified by the resolve method.

private String
public final Path
resolveSibling(Path other)

Overrides default java.nio.file.Path.resolveSibling.

Resolves the given path against this path's parent path.

public final Path
resolveSibling(String other)

Overrides default java.nio.file.Path.resolveSibling.

Converts a given path string to a Path and resolves it against this path's parent path in exactly the manner specified by the resolveSibling method.

pack-priv final void
setAttribute(String attribute, Object value, LinkOption... options)

pack-priv final void
setTimes(FileTime mtime, FileTime atime, FileTime ctime)

public final boolean
startsWith(Path other)

Implements java.nio.file.Path.startsWith.

Tests if this path starts with the given path.

public final boolean
startsWith(String other)

Overrides default java.nio.file.Path.startsWith.

Tests if this path starts with a Path, constructed by converting the given path string, in exactly the manner specified by the startsWith(Path) method.

public final JrtPath
subpath(int beginIndex, int endIndex)

Implements java.nio.file.Path.subpath.

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

public final JrtPath
toAbsolutePath()

Implements java.nio.file.Path.toAbsolutePath.

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

public final File
toFile()

Overrides default java.nio.file.Path.toFile.

Returns a File object representing this path.

public final JrtPath
toRealPath(LinkOption... options)

Implements java.nio.file.Path.toRealPath.

Returns the real path of an existing file.

public final String
toString()

Overrides java.lang.Object.toString.

Implements java.nio.file.Path.toString.

Returns the string representation of this path.

public final URI
toUri()

Implements java.nio.file.Path.toUri.

Returns a URI to represent this path.

private static URI
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

H_ALPHAback to summary
private static final long H_ALPHA
H_ALPHANUMback to summary
private static final long H_ALPHANUM
H_DIGITback to summary
private static final long H_DIGIT
H_LOWALPHAback to summary
private static final long H_LOWALPHA
H_MARKback to summary
private static final long H_MARK
H_PATHback to summary
private static final long H_PATH
H_PCHARback to summary
private static final long H_PCHAR
H_UNRESERVEDback to summary
private static final long H_UNRESERVED
H_UPALPHAback to summary
private static final long H_UPALPHA
hexDigitsback to summary
private static final char[] hexDigits
jrtfsback to summary
pack-priv final JrtFileSystem jrtfs
L_ALPHAback to summary
private static final long L_ALPHA
L_ALPHANUMback to summary
private static final long L_ALPHANUM
L_DIGITback to summary
private static final long L_DIGIT
L_LOWALPHAback to summary
private static final long L_LOWALPHA
L_MARKback to summary
private static final long L_MARK
L_PATHback to summary
private static final long L_PATH
L_PCHARback to summary
private static final long L_PCHAR
L_UNRESERVEDback to summary
private static final long L_UNRESERVED
L_UPALPHAback to summary
private static final long L_UPALPHA
offsetsback to summary
private volatile int[] offsets
pathback to summary
private final String path
resolvedback to summary
private volatile String resolved

Constructor Detail

JrtPathback to summary
pack-priv JrtPath(JrtFileSystem jrtfs, String path)
JrtPathback to summary
pack-priv JrtPath(JrtFileSystem jrtfs, String path, boolean normalized)

Method Detail

checkAccessback to summary
pack-priv final void checkAccess(AccessMode... modes) throws IOException
checkPathback to summary
private JrtPath checkPath(Path path)
compareToback to summary
public final int compareTo(Path other)

Implements java.nio.file.Path.compareTo.

Doc from java.nio.file.Path.compareTo.

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.

Annotations
@Override
copyback to summary
pack-priv final void copy(JrtPath target, CopyOption... options) throws IOException
copyToTargetback to summary
private void copyToTarget(JrtPath target, CopyOption... options) throws IOException
createDirectoryback to summary
pack-priv final void createDirectory(FileAttribute<?>... attrs) throws IOException
deleteback to summary
pack-priv final void delete() throws IOException
deleteIfExistsback to summary
pack-priv final void deleteIfExists() throws IOException
endsWithback to summary
public final boolean endsWith(Path other)

Implements java.nio.file.Path.endsWith.

Doc from java.nio.file.Path.endsWith.

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.

Annotations
@Override
endsWithback to summary
public final boolean endsWith(String other)

Overrides default java.nio.file.Path.endsWith.

Doc from java.nio.file.Path.endsWith.

Tests if this path ends with a Path, constructed by converting the given path string, in exactly the manner specified by the endsWith(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.

Annotations
@Override
equalsback to summary
public final boolean equals(Object obj)

Overrides java.lang.Object.equals.

Implements java.nio.file.Path.equals.

Doc from java.nio.file.Path.equals.

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 isSameFile method may be used to check if two paths locate the same file.

This method satisfies the general contract of the Object.equals method.

Annotations
@Override
equalsNameAtback to summary
private boolean equalsNameAt(JrtPath other, int index)
existsback to summary
pack-priv final boolean exists()
getAttributesback to summary
pack-priv final JrtFileAttributes getAttributes(LinkOption... options) throws IOException
getFileNameback to summary
public final JrtPath getFileName()

Implements java.nio.file.Path.getFileName.

Doc from java.nio.file.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.

Annotations
@Override
getFileStoreback to summary
pack-priv final FileStore getFileStore() throws IOException
getFileSystemback to summary
public JrtFileSystem getFileSystem()

Implements java.nio.file.Path.getFileSystem.

Doc from java.nio.file.Path.getFileSystem.

Returns the file system that created this object.

Annotations
@Override
getNameback to summary
pack-priv final String getName()
getNameback to summary
public final JrtPath getName(int index)

Implements java.nio.file.Path.getName.

Doc from java.nio.file.Path.getName.

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 count-1.

Annotations
@Override
getNameCountback to summary
public final int getNameCount()

Implements java.nio.file.Path.getNameCount.

Doc from java.nio.file.Path.getNameCount.

Returns the number of name elements in the path.

Annotations
@Override
getParentback to summary
public final JrtPath getParent()

Implements java.nio.file.Path.getParent.

Doc from java.nio.file.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 normalize method, to eliminate redundant names, for cases where shell-like navigation is required.

If this path has more than one element, and no root component, then this method is equivalent to evaluating the expression:

subpath(0, getNameCount()-1);
subpath(0, getNameCount()-1);
Annotations
@Override
getResolvedback to summary
private String getResolved()
getResolvedPathback to summary
pack-priv final String getResolvedPath()
getRootback to summary
public final JrtPath getRoot()

Implements java.nio.file.Path.getRoot.

Doc from 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.

Annotations
@Override
hashCodeback to summary
public final int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.nio.file.Path.hashCode.

Doc from java.nio.file.Path.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 Object.hashCode method.

Annotations
@Override
highMaskback to summary
private static long highMask(String chars)
highMaskback to summary
private static long highMask(char first, char last)
initOffsetsback to summary
private void initOffsets()
isAbsoluteback to summary
public final boolean isAbsolute()

Implements java.nio.file.Path.isAbsolute.

Doc from java.nio.file.Path.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.

Annotations
@Override
isHiddenback to summary
pack-priv final boolean isHidden()
isSameFileback to summary
pack-priv final boolean isSameFile(Path other) throws IOException
iteratorback to summary
public final Iterator<Path> iterator()

Overrides default java.nio.file.Path.iterator.

Doc from java.nio.file.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 root component, if present, is not returned by the iterator.

Annotations
@Override
lowMaskback to summary
private static long lowMask(String chars)
lowMaskback to summary
private static long lowMask(char first, char last)
matchback to summary
private static boolean match(char c, long lowMask, long highMask)
moveback to summary
pack-priv final void move(JrtPath target, CopyOption... options) throws IOException
newByteChannelback to summary
pack-priv final SeekableByteChannel newByteChannel(Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException
newDirectoryStreamback to summary
pack-priv final DirectoryStream<Path> newDirectoryStream(DirectoryStream.Filter<? super Path> filter) throws IOException
newFileChannelback to summary
pack-priv final FileChannel newFileChannel(Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException
newInputStreamback to summary
pack-priv final InputStream newInputStream(OpenOption... options) throws IOException
newOutputStreamback to summary
pack-priv final OutputStream newOutputStream(OpenOption... options) throws IOException
normalizeback to summary
public final JrtPath normalize()

Implements java.nio.file.Path.normalize.

Doc from java.nio.file.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.

Annotations
@Override
normalizeback to summary
private static String normalize(String path)
normalizeback to summary
private static String normalize(String path, int off)
readAttributesback to summary
pack-priv final Map<String, Object> readAttributes(String attributes, LinkOption... options) throws IOException
registerback to summary
public final WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers)

Implements java.nio.file.Path.register.

Doc from java.nio.file.Path.register.

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:

The 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 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.

Annotations
@Override
registerback to summary
public final WatchKey register(WatchService watcher, WatchEvent.Kind<?>... events)

Overrides default java.nio.file.Path.register.

Doc from java.nio.file.Path.register.

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

register(watcher, events, new WatchEvent.Modifier[0]);
register(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);
Path dir = ...
WatchService watcher = ...

WatchKey key = dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY);
Annotations
@Override
relativizeback to summary
public final JrtPath relativize(Path other)

Implements java.nio.file.Path.relativize.

Doc from java.nio.file.Path.relativize.

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

Relativization is the inverse of resolution. This method attempts to construct a relative path that when resolved 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 root 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 equal then an empty path is returned.

For any two normalized 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 same 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".

Annotations
@Override
resolveback to summary
public final JrtPath resolve(Path other)

Implements java.nio.file.Path.resolve.

Doc from java.nio.file.Path.resolve.

Resolve the given path against this path.

If the other parameter is an absolute 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 root component, in which case this method joins the given path to this path and returns a resulting path that ends with the given path. Where the given path has a root component then resolution is highly implementation dependent and therefore unspecified.

Annotations
@Override
resolveback to summary
public final JrtPath resolve(String other)

Overrides default java.nio.file.Path.resolve.

Doc from java.nio.file.Path.resolve.

Converts a given path string to a Path and resolves it against this Path in exactly the manner specified by the resolve 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".

Annotations
@Override
resolvePathback to summary
private String resolvePath()
resolveSiblingback to summary
public final Path resolveSibling(Path other)

Overrides default java.nio.file.Path.resolveSibling.

Doc from java.nio.file.Path.resolveSibling.

Resolves the given path against this path's parent 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 absolute, 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.

Annotations
@Override
resolveSiblingback to summary
public final Path resolveSibling(String other)

Overrides default java.nio.file.Path.resolveSibling.

Doc from java.nio.file.Path.resolveSibling.

Converts a given path string to a Path and resolves it against this path's parent path in exactly the manner specified by the resolveSibling method.

Annotations
@Override
setAttributeback to summary
pack-priv final void setAttribute(String attribute, Object value, LinkOption... options) throws IOException
setTimesback to summary
pack-priv final void setTimes(FileTime mtime, FileTime atime, FileTime ctime) throws IOException
startsWithback to summary
public final boolean startsWith(Path other)

Implements java.nio.file.Path.startsWith.

Doc from java.nio.file.Path.startsWith.

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.

Annotations
@Override
startsWithback to summary
public final boolean startsWith(String other)

Overrides default java.nio.file.Path.startsWith.

Doc from java.nio.file.Path.startsWith.

Tests if this path starts with a Path, constructed by converting the given path string, in exactly the manner specified by the startsWith(Path) method. On UNIX for example, the path "foo/bar" starts with "foo" and "foo/bar". It does not start with "f" or "fo".

Annotations
@Override
subpathback to summary
public final JrtPath subpath(int beginIndex, int endIndex)

Implements java.nio.file.Path.subpath.

Doc from java.nio.file.Path.subpath.

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 count-1. The returned Path object has the name elements that begin at beginIndex and extend to the element at index endIndex-1.

Annotations
@Override
toAbsolutePathback to summary
public final JrtPath toAbsolutePath()

Implements java.nio.file.Path.toAbsolutePath.

Doc from java.nio.file.Path.toAbsolutePath.

Returns a Path object representing the absolute path of this path. Where this Path is associated with the default provider, then the returned absolute path will have a non-null root component.

If this path is already absolute 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.

Annotations
@Override
toFileback to summary
public final File toFile()

Overrides default java.nio.file.Path.toFile.

Doc from java.nio.file.Path.toFile.

Returns a 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 toPath method then there is no guarantee that the File object returned by this method is equal to the original File.

Annotations
@Override
toRealPathback to summary
public final JrtPath toRealPath(LinkOption... options) throws IOException

Implements java.nio.file.Path.toRealPath.

Doc from java.nio.file.Path.toRealPath.

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 absolute path that locates the same 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 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 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 is guaranteed that the resulting path will locate the same file as this path.

Annotations
@Override
Exceptions
IOException:
if the file does not exist or an I/O error occurs
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Implements java.nio.file.Path.toString.

Doc from java.nio.file.Path.toString.

Returns the string representation of this path.

If this path was created by converting a path string using the getPath 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 separator to separate names in the path.

Annotations
@Override
toUriback to summary
public final URI toUri()

Implements java.nio.file.Path.toUri.

Doc from java.nio.file.Path.toUri.

Returns a URI to represent this path.

This method constructs an absolute URI with a scheme 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 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 the URI may be used to construct a 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 java.io.File class. For a given Path p it is guaranteed that

Path.of(p.toUri()).equals(p .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.

Annotations
@Override
toUriback to summary
private static URI toUri(String str)