# Uses of Interface
java.nio.file.Path

Packages that use Path
Package
Description
com.sun.net.httpserver
Provides a simple high-level Http server API, which can be used to build embedded HTTP servers.
java.io
Provides for system input and output through data streams, serialization and the file system.
java.lang.classfile
Provides classfile parsing, generation, and transformation library.
java.lang.foreign
Provides low-level access to memory and functions outside the Java runtime.
java.lang.module
Classes to support module descriptors and creating configurations of modules by means of resolution and service binding.
java.net
Provides the classes for implementing networking applications.
java.net.http
HTTP Client and WebSocket APIs
java.nio.channels
Defines channels, which represent connections to entities that are capable of performing I/O operations, such as files and sockets; defines selectors, for multiplexed, non-blocking I/O operations.
java.nio.file
Defines interfaces and classes for the Java virtual machine to access files, file attributes, and file systems.
java.nio.file.spi
Service-provider classes for the `java.nio.file` package.
java.util
Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes.
javax.tools
Provides interfaces for tools which can be invoked from a program, for example, compilers.
jdk.jfr
This package provides classes to create events and control Flight Recorder.
jdk.jfr.consumer
This package contains classes for consuming Flight Recorder data.
jdk.management.jfr
This package contains classes to control and monitor Flight Recorder over Java Management Extensions (JMX).

## Uses of Path in com.sun.net.httpserver

Methods in com.sun.net.httpserver with parameters of type Path
Modifier and Type
Method
Description
`static HttpHandler`
SimpleFileServer.`createFileHandler(Path rootDirectory)`
Creates a file handler that serves files from a given directory path (and its subdirectories).
`static HttpServer`
SimpleFileServer.`createFileServer(InetSocketAddress addr, Path rootDirectory, SimpleFileServer.OutputLevel outputLevel)`
Creates a file server that serves files from a given path.

## Uses of Path in java.io

Methods in java.io that return Path
Modifier and Type
Method
Description
`Path`
File.`toPath()`
Returns a `java.nio.file.Path` object constructed from this abstract path.

## Uses of Path in java.lang.classfile

Methods in java.lang.classfile with parameters of type Path
Modifier and Type
Method
Description
`default void`
ClassFile.`buildModuleTo(Path path, ModuleAttribute moduleAttribute)`
Builds a module descriptor into a file in a file system.
`default void`
ClassFile.`buildModuleTo(Path path, ModuleAttribute moduleAttribute, Consumer<? super ClassBuilder> handler)`
Builds a module descriptor into a file in a file system.
`default void`
ClassFile.`buildTo(Path path, ClassEntry thisClassEntry, ConstantPoolBuilder constantPool, Consumer<? super ClassBuilder> handler)`
Builds a `class` file into a file in a file system using the provided constant pool builder.
`default void`
ClassFile.`buildTo(Path path, ClassDesc thisClass, Consumer<ClassBuilder> handler)`
Builds a `class` file into a file in a file system.
`default ClassModel`
ClassFile.`parse(Path path)`
Parses a `class` into a `ClassModel`.
`default List<VerifyError>`
ClassFile.`verify(Path path)`
Verify a `class` file.

## Uses of Path in java.lang.foreign

Methods in java.lang.foreign with parameters of type Path
Modifier and Type
Method
Description
`static SymbolLookup`
SymbolLookup.`libraryLookup(Path path, Arena arena)`
Restricted.
Loads a library from the given path (if not already loaded) and creates a symbol lookup for symbols in that library.

## Uses of Path in java.lang.module

Methods in java.lang.module with parameters of type Path
Modifier and Type
Method
Description
`static ModuleFinder`
ModuleFinder.`of(Path... entries)`
Returns a module finder that locates modules on the file system by searching a sequence of directories and/or packaged modules.

## Uses of Path in java.net

Methods in java.net that return Path
Modifier and Type
Method
Description
`Path`
UnixDomainSocketAddress.`getPath()`
Returns this address's path.
Methods in java.net with parameters of type Path
Modifier and Type
Method
Description
`static UnixDomainSocketAddress`
UnixDomainSocketAddress.`of(Path path)`
Creates a UnixDomainSocketAddress for the given path.

## Uses of Path in java.net.http

Methods in java.net.http that return types with arguments of type Path
Modifier and Type
Method
Description
`static HttpResponse.BodyHandler<Path>`
HttpResponse.BodyHandlers.`ofFile(Path file)`
Returns a `BodyHandler<Path>` that returns a `BodySubscriber``<Path>`.
`static HttpResponse.BodyHandler<Path>`
HttpResponse.BodyHandlers.`ofFile(Path file, OpenOption... openOptions)`
Returns a `BodyHandler<Path>` that returns a `BodySubscriber``<Path>` obtained from `BodySubscribers.ofFile(Path,OpenOption...)`.
`static HttpResponse.BodySubscriber<Path>`
HttpResponse.BodySubscribers.`ofFile(Path file)`
Returns a `BodySubscriber` which stores the response body in a file opened with the given name.
`static HttpResponse.BodySubscriber<Path>`
HttpResponse.BodySubscribers.`ofFile(Path file, OpenOption... openOptions)`
Returns a `BodySubscriber` which stores the response body in a file opened with the given options and name.
`static HttpResponse.BodyHandler<Path>`
HttpResponse.BodyHandlers.`ofFileDownload(Path directory, OpenOption... openOptions)`
Returns a `BodyHandler<Path>` that returns a `BodySubscriber`<`Path`> where the download directory is specified, but the filename is obtained from the `Content-Disposition` response header.
Methods in java.net.http with parameters of type Path
Modifier and Type
Method
Description
`static HttpRequest.BodyPublisher`
HttpRequest.BodyPublishers.`ofFile(Path path)`
A request body publisher that takes data from the contents of a File.
`static HttpResponse.BodyHandler<Path>`
HttpResponse.BodyHandlers.`ofFile(Path file)`
Returns a `BodyHandler<Path>` that returns a `BodySubscriber``<Path>`.
`static HttpResponse.BodyHandler<Path>`
HttpResponse.BodyHandlers.`ofFile(Path file, OpenOption... openOptions)`
Returns a `BodyHandler<Path>` that returns a `BodySubscriber``<Path>` obtained from `BodySubscribers.ofFile(Path,OpenOption...)`.
`static HttpResponse.BodySubscriber<Path>`
HttpResponse.BodySubscribers.`ofFile(Path file)`
Returns a `BodySubscriber` which stores the response body in a file opened with the given name.
`static HttpResponse.BodySubscriber<Path>`
HttpResponse.BodySubscribers.`ofFile(Path file, OpenOption... openOptions)`
Returns a `BodySubscriber` which stores the response body in a file opened with the given options and name.
`static HttpResponse.BodyHandler<Path>`
HttpResponse.BodyHandlers.`ofFileDownload(Path directory, OpenOption... openOptions)`
Returns a `BodyHandler<Path>` that returns a `BodySubscriber`<`Path`> where the download directory is specified, but the filename is obtained from the `Content-Disposition` response header.

## Uses of Path in java.nio.channels

Methods in java.nio.channels with parameters of type Path
Modifier and Type
Method
Description
`static AsynchronousFileChannel`
AsynchronousFileChannel.`open(Path file, OpenOption... options)`
Opens or creates a file for reading and/or writing, returning an asynchronous file channel to access the file.
`static AsynchronousFileChannel`
AsynchronousFileChannel.`open(Path file, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs)`
Opens or creates a file for reading and/or writing, returning an asynchronous file channel to access the file.
`static FileChannel`
FileChannel.`open(Path path, OpenOption... options)`
Opens or creates a file, returning a file channel to access the file.
`static FileChannel`
FileChannel.`open(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)`
Opens or creates a file, returning a file channel to access the file.

## Uses of Path in java.nio.file

Subinterfaces with type arguments of type Path in java.nio.file
Modifier and Type
Interface
Description
`interface`
`Path`
An object that may be used to locate a file in a file system.
`interface`
`Path`
An object that may be used to locate a file in a file system.
Fields in java.nio.file with type parameters of type Path
Modifier and Type
Field
Description
`static final WatchEvent.Kind<Path>`
StandardWatchEventKinds.`ENTRY_CREATE`
Directory entry created.
`static final WatchEvent.Kind<Path>`
StandardWatchEventKinds.`ENTRY_DELETE`
Directory entry deleted.
`static final WatchEvent.Kind<Path>`
StandardWatchEventKinds.`ENTRY_MODIFY`
Directory entry modified.
Methods in java.nio.file that return Path
Modifier and Type
Method
Description
`static Path`
Files.`copy(Path source, Path target, CopyOption... options)`
Copy a file to a target file.
`static Path`
Files.`createDirectories(Path dir, FileAttribute<?>... attrs)`
Creates a directory by creating all nonexistent parent directories first.
`static Path`
Files.`createDirectory(Path dir, FileAttribute<?>... attrs)`
Creates a new directory.
`static Path`
Files.`createFile(Path path, FileAttribute<?>... attrs)`
Creates a new and empty file, failing if the file already exists.
`static Path`
Files.`createLink(Path link, Path existing)`
Creates a new link (directory entry) for an existing file (optional operation).
`static Path`
Files.`createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs)`
Creates a symbolic link to a target (optional operation).
`static Path`
Files.`createTempDirectory(String prefix, FileAttribute<?>... attrs)`
Creates a new directory in the default temporary-file directory, using the given prefix to generate its name.
`static Path`
Files.`createTempDirectory(Path dir, String prefix, FileAttribute<?>... attrs)`
Creates a new directory in the specified directory, using the given prefix to generate its name.
`static Path`
Files.`createTempFile(String prefix, String suffix, FileAttribute<?>... attrs)`
Creates an empty file in the default temporary-file directory, using the given prefix and suffix to generate its name.
`static Path`
Files.`createTempFile(Path dir, String prefix, String suffix, FileAttribute<?>... attrs)`
Creates a new empty file in the specified directory, using the given prefix and suffix strings to generate its name.
`static Path`
Paths.`get(String first, String... more)`
Converts a path string, or a sequence of strings that when joined form a path string, to a `Path`.
`static Path`
Paths.`get(URI uri)`
Converts the given URI to a `Path` object.
`Path`
Path.`getFileName()`
Returns the name of the file or directory denoted by this path as a `Path` object.
`Path`
Path.`getName(int index)`
Returns a name element of this path as a `Path` object.
`Path`
Path.`getParent()`
Returns the parent path, or `null` if this path does not have a parent.
`abstract Path`
FileSystem.`getPath(String first, String... more)`
Converts a path string, or a sequence of strings that when joined form a path string, to a `Path`.
`Path`
Path.`getRoot()`
Returns the root component of this path as a `Path` object, or `null` if this path does not have a root component.
`static Path`
Files.`move(Path source, Path target, CopyOption... options)`
Move or rename a file to a target file.
`Path`
Path.`normalize()`
Returns a path that is this path with redundant name elements eliminated.
`static Path`
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.
`static Path`
Path.`of(URI uri)`
Returns a `Path` by converting a URI.
`static Path`
Files.`readSymbolicLink(Path link)`
Reads the target of a symbolic link (optional operation).
`Path`
Path.`relativize(Path other)`
Constructs a relative path between this path and a given path.
`default Path`
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 `resolve` method.
`default Path`
Path.`resolve(String first, String... more)`
Converts a path string to a path, resolves that path against this path, and then iteratively performs the same procedure for any additional path strings.
`Path`
Path.`resolve(Path other)`
Resolve the given path against this path.
`default Path`
Path.`resolve(Path first, Path... more)`
Resolves a path against this path, and then iteratively resolves any additional paths.
`default Path`
Path.`resolveSibling(String other)`
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.
`default Path`
Path.`resolveSibling(Path other)`
Resolves the given path against this path's `parent` path.
`static Path`
Files.`setAttribute(Path path, String attribute, Object value, LinkOption... options)`
Sets the value of a file attribute.
`static Path`
Files.`setLastModifiedTime(Path path, FileTime time)`
Updates a file's last modified time attribute.
`static Path`
Files.`setOwner(Path path, UserPrincipal owner)`
Updates the file owner.
`static Path`
Files.`setPosixFilePermissions(Path path, Set<PosixFilePermission> perms)`
Sets a file's POSIX permissions.
`Path`
Path.`subpath(int beginIndex, int endIndex)`
Returns a relative `Path` that is a subsequence of the name elements of this path.
`Path`
Path.`toAbsolutePath()`
Returns a `Path` object representing the absolute path of this path.
`Path`
Path.`toRealPath(LinkOption... options)`
Returns the real path of an existing file.
`static Path`
Files.`walkFileTree(Path start, FileVisitor<? super Path> visitor)`
Walks a file tree.
`static Path`
Files.`walkFileTree(Path start, Set<FileVisitOption> options, int maxDepth, FileVisitor<? super Path> visitor)`
Walks a file tree.
`static Path`
Files.`write(Path path, byte[] bytes, OpenOption... options)`
Writes bytes to a file.
`static Path`
Files.`write(Path path, Iterable<? extends CharSequence> lines, Charset cs, OpenOption... options)`
Write lines of text to a file.
`static Path`
Files.`write(Path path, Iterable<? extends CharSequence> lines, OpenOption... options)`
Write lines of text to a file.
`static Path`
Files.`writeString(Path path, CharSequence csq, Charset cs, OpenOption... options)`
Write a CharSequence to a file.
`static Path`
Files.`writeString(Path path, CharSequence csq, OpenOption... options)`
Write a CharSequence to a file.
Methods in java.nio.file that return types with arguments of type Path
Modifier and Type
Method
Description
`static Stream<Path>`
Files.`find(Path start, int maxDepth, BiPredicate<Path, BasicFileAttributes> matcher, FileVisitOption... options)`
Returns a `Stream` that is lazily populated with `Path` by searching for files in a file tree rooted at a given starting file.
`abstract Iterable<Path>`
FileSystem.`getRootDirectories()`
Returns an object to iterate over the paths of the root directories.
`default Iterator<Path>`
Path.`iterator()`
Returns an iterator over the name elements of this path.
`static Stream<Path>`
Files.`list(Path dir)`
Returns a lazily populated `Stream`, the elements of which are the entries in the directory.
`static DirectoryStream<Path>`
Files.`newDirectoryStream(Path dir)`
Opens a directory, returning a `DirectoryStream` to iterate over all entries in the directory.
`static DirectoryStream<Path>`
Files.`newDirectoryStream(Path dir, String glob)`
Opens a directory, returning a `DirectoryStream` to iterate over the entries in the directory.
`static DirectoryStream<Path>`
Files.`newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)`
Opens a directory, returning a `DirectoryStream` to iterate over the entries in the directory.
`static Stream<Path>`
Files.`walk(Path start, int maxDepth, FileVisitOption... options)`
Returns a `Stream` that is lazily populated with `Path` by walking the file tree rooted at a given starting file.
`static Stream<Path>`
Files.`walk(Path start, FileVisitOption... options)`
Returns a `Stream` that is lazily populated with `Path` by walking the file tree rooted at a given starting file.
Methods in java.nio.file with parameters of type Path
Modifier and Type
Method
Description
`int`
Path.`compareTo(Path other)`
Compares two abstract paths lexicographically.
`static long`
Files.`copy(InputStream in, Path target, CopyOption... options)`
Copies all bytes from an input stream to a file.
`static long`
Files.`copy(Path source, OutputStream out)`
Copies all bytes from a file to an output stream.
`static Path`
Files.`copy(Path source, Path target, CopyOption... options)`
Copy a file to a target file.
`static Path`
Files.`createDirectories(Path dir, FileAttribute<?>... attrs)`
Creates a directory by creating all nonexistent parent directories first.
`static Path`
Files.`createDirectory(Path dir, FileAttribute<?>... attrs)`
Creates a new directory.
`static Path`
Files.`createFile(Path path, FileAttribute<?>... attrs)`
Creates a new and empty file, failing if the file already exists.
`static Path`
Files.`createLink(Path link, Path existing)`
Creates a new link (directory entry) for an existing file (optional operation).
`static Path`
Files.`createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs)`
Creates a symbolic link to a target (optional operation).
`static Path`
Files.`createTempDirectory(Path dir, String prefix, FileAttribute<?>... attrs)`
Creates a new directory in the specified directory, using the given prefix to generate its name.
`static Path`
Files.`createTempFile(Path dir, String prefix, String suffix, FileAttribute<?>... attrs)`
Creates a new empty file in the specified directory, using the given prefix and suffix strings to generate its name.
`static void`
Files.`delete(Path path)`
Deletes a file.
`static boolean`
Files.`deleteIfExists(Path path)`
Deletes a file if it exists.
`boolean`
Path.`endsWith(Path other)`
Tests if this path ends with the given path.
`static boolean`
Files.`exists(Path path, LinkOption... options)`
Tests whether a file exists.
`static Stream<Path>`
Files.`find(Path start, int maxDepth, BiPredicate<Path, BasicFileAttributes> matcher, FileVisitOption... options)`
Returns a `Stream` that is lazily populated with `Path` by searching for files in a file tree rooted at a given starting file.
`static Object`
Files.`getAttribute(Path path, String attribute, LinkOption... options)`
Reads the value of a file attribute.
`static <V extends FileAttributeView>
V`
Files.`getFileAttributeView(Path path, Class<V> type, LinkOption... options)`
Returns a file attribute view of a given type.
`static FileStore`
Files.`getFileStore(Path path)`
Returns the `FileStore` representing the file store where a file is located.
`static FileTime`
Files.`getLastModifiedTime(Path path, LinkOption... options)`
Returns a file's last modified time.
`static UserPrincipal`
Files.`getOwner(Path path, LinkOption... options)`
Returns the owner of a file.
`static Set<PosixFilePermission>`
Files.`getPosixFilePermissions(Path path, LinkOption... options)`
Returns a file's POSIX file permissions.
`static boolean`
Files.`isDirectory(Path path, LinkOption... options)`
Tests whether a file is a directory.
`static boolean`
Files.`isExecutable(Path path)`
Tests whether a file is executable.
`static boolean`
Files.`isHidden(Path path)`
Tells whether or not a file is considered hidden.
`static boolean`
Files.`isReadable(Path path)`
Tests whether a file is readable.
`static boolean`
Files.`isRegularFile(Path path, LinkOption... options)`
Tests whether a file is a regular file with opaque content.
`static boolean`
Files.`isSameFile(Path path, Path path2)`
Tests if two paths locate the same file.
`static boolean`
Files.`isSymbolicLink(Path path)`
Tests whether a file is a symbolic link.
`static boolean`
Files.`isWritable(Path path)`
Tests whether a file is writable.
`static Stream<String>`
Files.`lines(Path path)`
Read all lines from a file as a `Stream`.
`static Stream<String>`
Files.`lines(Path path, Charset cs)`
Read all lines from a file as a `Stream`.
`static Stream<Path>`
Files.`list(Path dir)`
Returns a lazily populated `Stream`, the elements of which are the entries in the directory.
`boolean`
PathMatcher.`matches(Path path)`
Tells if given path matches this matcher's pattern.
`static long`
Files.`mismatch(Path path, Path path2)`
Finds and returns the position of the first mismatched byte in the content of two files, or `-1L` if there is no mismatch.
`static Path`
Files.`move(Path source, Path target, CopyOption... options)`
Move or rename a file to a target file.
`static BufferedReader`
Files.`newBufferedReader(Path path)`
Opens a file for reading, returning a `BufferedReader` to read text from the file in an efficient manner.
`static BufferedReader`
Files.`newBufferedReader(Path path, Charset cs)`
Opens a file for reading, returning a `BufferedReader` that may be used to read text from the file in an efficient manner.
`static BufferedWriter`
Files.`newBufferedWriter(Path path, Charset cs, OpenOption... options)`
Opens or creates a file for writing, returning a `BufferedWriter` that may be used to write text to the file in an efficient manner.
`static BufferedWriter`
Files.`newBufferedWriter(Path path, OpenOption... options)`
Opens or creates a file for writing, returning a `BufferedWriter` to write text to the file in an efficient manner.
`static SeekableByteChannel`
Files.`newByteChannel(Path path, OpenOption... options)`
Opens or creates a file, returning a seekable byte channel to access the file.
`static SeekableByteChannel`
Files.`newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)`
Opens or creates a file, returning a seekable byte channel to access the file.
`static DirectoryStream<Path>`
Files.`newDirectoryStream(Path dir)`
Opens a directory, returning a `DirectoryStream` to iterate over all entries in the directory.
`static DirectoryStream<Path>`
Files.`newDirectoryStream(Path dir, String glob)`
Opens a directory, returning a `DirectoryStream` to iterate over the entries in the directory.
`static DirectoryStream<Path>`
Files.`newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)`
Opens a directory, returning a `DirectoryStream` to iterate over the entries in the directory.
`static FileSystem`
FileSystems.`newFileSystem(Path path)`
Constructs a new `FileSystem` to access the contents of a file as a file system.
`static FileSystem`
FileSystems.`newFileSystem(Path path, ClassLoader loader)`
Constructs a new `FileSystem` to access the contents of a file as a file system.
`static FileSystem`
FileSystems.`newFileSystem(Path path, Map<String,?> env)`
Constructs a new `FileSystem` to access the contents of a file as a file system.
`static FileSystem`
FileSystems.`newFileSystem(Path path, Map<String,?> env, ClassLoader loader)`
Constructs a new `FileSystem` to access the contents of a file as a file system.
`static InputStream`
Files.`newInputStream(Path path, OpenOption... options)`
Opens a file, returning an input stream to read from the file.
`static OutputStream`
Files.`newOutputStream(Path path, OpenOption... options)`
Opens or creates a file, returning an output stream that may be used to write bytes to the file.
`static boolean`
Files.`notExists(Path path, LinkOption... options)`
Tests whether the file located by this path does not exist.
`static String`
Files.`probeContentType(Path path)`
Probes the content type of a file.
`static byte[]`
Files.`readAllBytes(Path path)`
Reads all the bytes from a file.
`static List<String>`
Files.`readAllLines(Path path)`
Read all lines from a file.
`static List<String>`
Files.`readAllLines(Path path, Charset cs)`
Read all lines from a file.
`static <A extends BasicFileAttributes>
A`
Files.`readAttributes(Path path, Class<A> type, LinkOption... options)`
Reads a file's attributes as a bulk operation.
`static Map<String,Object>`
Files.`readAttributes(Path path, String attributes, LinkOption... options)`
Reads a set of file attributes as a bulk operation.
`static String`
Files.`readString(Path path)`
Reads all content from a file into a string, decoding from bytes to characters using the `UTF-8` `charset`.
`static String`
Files.`readString(Path path, Charset cs)`
Reads all characters from a file into a string, decoding from bytes to characters using the specified charset.
`static Path`
Files.`readSymbolicLink(Path link)`
Reads the target of a symbolic link (optional operation).
`Path`
Path.`relativize(Path other)`
Constructs a relative path between this path and a given path.
`Path`
Path.`resolve(Path other)`
Resolve the given path against this path.
`default Path`
Path.`resolve(Path first, Path... more)`
Resolves a path against this path, and then iteratively resolves any additional paths.
`default Path`
Path.`resolveSibling(Path other)`
Resolves the given path against this path's `parent` path.
`static Path`
Files.`setAttribute(Path path, String attribute, Object value, LinkOption... options)`
Sets the value of a file attribute.
`static Path`
Files.`setLastModifiedTime(Path path, FileTime time)`
Updates a file's last modified time attribute.
`static Path`
Files.`setOwner(Path path, UserPrincipal owner)`
Updates the file owner.
`static Path`
Files.`setPosixFilePermissions(Path path, Set<PosixFilePermission> perms)`
Sets a file's POSIX permissions.
`static long`
Files.`size(Path path)`
Returns the size of a file (in bytes).
`boolean`
Path.`startsWith(Path other)`
Tests if this path starts with the given path.
`static Stream<Path>`
Files.`walk(Path start, int maxDepth, FileVisitOption... options)`
Returns a `Stream` that is lazily populated with `Path` by walking the file tree rooted at a given starting file.
`static Stream<Path>`
Files.`walk(Path start, FileVisitOption... options)`
Returns a `Stream` that is lazily populated with `Path` by walking the file tree rooted at a given starting file.
`static Path`
Files.`walkFileTree(Path start, FileVisitor<? super Path> visitor)`
Walks a file tree.
`static Path`
Files.`walkFileTree(Path start, Set<FileVisitOption> options, int maxDepth, FileVisitor<? super Path> visitor)`
Walks a file tree.
`static Path`
Files.`write(Path path, byte[] bytes, OpenOption... options)`
Writes bytes to a file.
`static Path`
Files.`write(Path path, Iterable<? extends CharSequence> lines, Charset cs, OpenOption... options)`
Write lines of text to a file.
`static Path`
Files.`write(Path path, Iterable<? extends CharSequence> lines, OpenOption... options)`
Write lines of text to a file.
`static Path`
Files.`writeString(Path path, CharSequence csq, Charset cs, OpenOption... options)`
Write a CharSequence to a file.
`static Path`
Files.`writeString(Path path, CharSequence csq, OpenOption... options)`
Write a CharSequence to a file.
Method parameters in java.nio.file with type arguments of type Path
Modifier and Type
Method
Description
`static Stream<Path>`
Files.`find(Path start, int maxDepth, BiPredicate<Path, BasicFileAttributes> matcher, FileVisitOption... options)`
Returns a `Stream` that is lazily populated with `Path` by searching for files in a file tree rooted at a given starting file.
`static DirectoryStream<Path>`
Files.`newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)`
Opens a directory, returning a `DirectoryStream` to iterate over the entries in the directory.
`static Path`
Files.`walkFileTree(Path start, FileVisitor<? super Path> visitor)`
Walks a file tree.
`static Path`
Files.`walkFileTree(Path start, Set<FileVisitOption> options, int maxDepth, FileVisitor<? super Path> visitor)`
Walks a file tree.

## Uses of Path in java.nio.file.spi

Methods in java.nio.file.spi that return Path
Modifier and Type
Method
Description
`abstract Path`
FileSystemProvider.`getPath(URI uri)`
Return a `Path` object by converting the given `URI`.
`Path`
FileSystemProvider.`readSymbolicLink(Path link)`
Reads the target of a symbolic link.
Methods in java.nio.file.spi that return types with arguments of type Path
Modifier and Type
Method
Description
`abstract DirectoryStream<Path>`
FileSystemProvider.`newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)`
Opens a directory, returning a `DirectoryStream` to iterate over the entries in the directory.
Methods in java.nio.file.spi with parameters of type Path
Modifier and Type
Method
Description
`abstract void`
FileSystemProvider.`checkAccess(Path path, AccessMode... modes)`
Checks the existence, and optionally the accessibility, of a file.
`abstract void`
FileSystemProvider.`copy(Path source, Path target, CopyOption... options)`
Copy a file to a target file.
`abstract void`
FileSystemProvider.`createDirectory(Path dir, FileAttribute<?>... attrs)`
Creates a new directory.
`void`
FileSystemProvider.`createLink(Path link, Path existing)`
Creates a new link (directory entry) for an existing file.
`void`
FileSystemProvider.`createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs)`
Creates a symbolic link to a target.
`abstract void`
FileSystemProvider.`delete(Path path)`
Deletes a file.
`boolean`
FileSystemProvider.`deleteIfExists(Path path)`
Deletes a file if it exists.
`boolean`
FileSystemProvider.`exists(Path path, LinkOption... options)`
Tests whether a file exists.
`abstract <V extends FileAttributeView>
V`
FileSystemProvider.`getFileAttributeView(Path path, Class<V> type, LinkOption... options)`
Returns a file attribute view of a given type.
`abstract FileStore`
FileSystemProvider.`getFileStore(Path path)`
Returns the `FileStore` representing the file store where a file is located.
`abstract boolean`
FileSystemProvider.`isHidden(Path path)`
Tells whether or not a file is considered hidden.
`abstract boolean`
FileSystemProvider.`isSameFile(Path path, Path path2)`
Tests if two paths locate the same file.
`abstract void`
FileSystemProvider.`move(Path source, Path target, CopyOption... options)`
Move or rename a file to a target file.
`AsynchronousFileChannel`
FileSystemProvider.`newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs)`
Opens or creates a file for reading and/or writing, returning an asynchronous file channel to access the file.
`abstract SeekableByteChannel`
FileSystemProvider.`newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)`
Opens or creates a file, returning a seekable byte channel to access the file.
`abstract DirectoryStream<Path>`
FileSystemProvider.`newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)`
Opens a directory, returning a `DirectoryStream` to iterate over the entries in the directory.
`FileChannel`
FileSystemProvider.`newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)`
Opens or creates a file for reading and/or writing, returning a file channel to access the file.
`FileSystem`
FileSystemProvider.`newFileSystem(Path path, Map<String,?> env)`
Constructs a new `FileSystem` to access the contents of a file as a file system.
`InputStream`
FileSystemProvider.`newInputStream(Path path, OpenOption... options)`
Opens a file, returning an input stream to read from the file.
`OutputStream`
FileSystemProvider.`newOutputStream(Path path, OpenOption... options)`
Opens or creates a file, returning an output stream that may be used to write bytes to the file.
`abstract String`
FileTypeDetector.`probeContentType(Path path)`
Probes the given file to guess its content type.
`abstract <A extends BasicFileAttributes>
A`
FileSystemProvider.`readAttributes(Path path, Class<A> type, LinkOption... options)`
Reads a file's attributes as a bulk operation.
`abstract Map<String,Object>`
FileSystemProvider.`readAttributes(Path path, String attributes, LinkOption... options)`
Reads a set of file attributes as a bulk operation.
`<A extends BasicFileAttributes>
A`
FileSystemProvider.`readAttributesIfExists(Path path, Class<A> type, LinkOption... options)`
Reads a file's attributes as a bulk operation if it exists.
`Path`
FileSystemProvider.`readSymbolicLink(Path link)`
Reads the target of a symbolic link.
`abstract void`
FileSystemProvider.`setAttribute(Path path, String attribute, Object value, LinkOption... options)`
Sets the value of a file attribute.
Method parameters in java.nio.file.spi with type arguments of type Path
Modifier and Type
Method
Description
`abstract DirectoryStream<Path>`
FileSystemProvider.`newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)`
Opens a directory, returning a `DirectoryStream` to iterate over the entries in the directory.

## Uses of Path in java.util

Constructors in java.util with parameters of type Path
Modifier
Constructor
Description
``
`Scanner(Path source)`
Constructs a new `Scanner` that produces values scanned from the specified file.
``
`Scanner(Path source, String charsetName)`
Constructs a new `Scanner` that produces values scanned from the specified file.
``
`Scanner(Path source, Charset charset)`
Constructs a new `Scanner` that produces values scanned from the specified file.

## Uses of Path in javax.tools

Methods in javax.tools that return Path
Modifier and Type
Method
Description
`default Path`
StandardJavaFileManager.`asPath(FileObject file)`
Returns the path, if any, underlying this file object (optional operation).
`Path`
StandardJavaFileManager.PathFactory.`getPath(String first, String... more)`
Converts a path string, or a sequence of strings that when joined form a path string, to a Path.
Methods in javax.tools that return types with arguments of type Path
Modifier and Type
Method
Description
`default Iterable<? extends Path>`
StandardJavaFileManager.`getLocationAsPaths(JavaFileManager.Location location)`
Returns the search path associated with the given location.
Methods in javax.tools with parameters of type Path
Modifier and Type
Method
Description
`default Iterable<? extends JavaFileObject>`
StandardJavaFileManager.`getJavaFileObjects(Path... paths)`
Returns file objects representing the given paths.
Method parameters in javax.tools with type arguments of type Path
Modifier and Type
Method
Description
`default Iterable<? extends JavaFileObject>`
StandardJavaFileManager.`getJavaFileObjectsFromPaths(Iterable<? extends Path> paths)`
Deprecated.
use `StandardJavaFileManager.getJavaFileObjectsFromPaths(Collection)` instead, to prevent the possibility of accidentally calling the method with a single `Path` as such an argument.
`default Iterable<? extends JavaFileObject>`
StandardJavaFileManager.`getJavaFileObjectsFromPaths(Collection<? extends Path> paths)`
Returns file objects representing the given paths.
`default void`
StandardJavaFileManager.`setLocationForModule(JavaFileManager.Location location, String moduleName, Collection<? extends Path> paths)`
Associates the given search path with the given module and location, which must be a module-oriented or output location.
`default void`
StandardJavaFileManager.`setLocationFromPaths(JavaFileManager.Location location, Collection<? extends Path> paths)`
Associates the given search path with the given location.

## Uses of Path in jdk.jfr

Methods in jdk.jfr that return Path
Modifier and Type
Method
Description
`Path`
Recording.`getDestination()`
Returns the destination file, where recording data is written when the recording stops, or `null` if no destination is set.
Methods in jdk.jfr with parameters of type Path
Modifier and Type
Method
Description
`static Configuration`
Configuration.`create(Path path)`
Reads a configuration from a file.
`void`
Recording.`dump(Path destination)`
Writes recording data to a file.
`void`
Recording.`setDestination(Path destination)`
Sets a location where data is written on recording stop, or `null` if data is not to be dumped.

## Uses of Path in jdk.jfr.consumer

Methods in jdk.jfr.consumer with parameters of type Path
Modifier and Type
Method
Description
`void`
RecordingStream.`dump(Path destination)`
Writes recording data to a file.
`static EventStream`
EventStream.`openFile(Path file)`
Creates an event stream from a file.
`static EventStream`
EventStream.`openRepository(Path directory)`
Creates an event stream from a disk repository.
`static List<RecordedEvent>`
RecordingFile.`readAllEvents(Path path)`
Returns a list of all events in a file.
`void`
RecordingFile.`write(Path destination, Predicate<RecordedEvent> filter)`
Filter out events and write them to a new file.
Constructors in jdk.jfr.consumer with parameters of type Path
Modifier
Constructor
Description
``
`RecordingFile(Path file)`
Creates a recording file.

## Uses of Path in jdk.management.jfr

Methods in jdk.management.jfr with parameters of type Path
Modifier and Type
Method
Description
`void`
RemoteRecordingStream.`dump(Path destination)`
Writes recording data to a file.
Constructors in jdk.management.jfr with parameters of type Path
Modifier
Constructor
Description
``
`RemoteRecordingStream(MBeanServerConnection connection, Path directory)`
Creates an event stream that operates against a `MBeanServerConnection` that has a registered `FlightRecorderMXBean`.