接口的使用
java.nio.file.Path
使用 Path 的包
包
描述
提供简单的高级 Http 服务 API,可用于构建嵌入式 HTTP 服务。
通过数据流、序列化和文件系统提供系统输入和输出。
提供对 Java 运行时之外的内存和函数的低级访问。
通过解析和服务绑定支持模块描述符和创建模块配置的类。
提供用于实现网络应用程序的类。
HTTP 客户端和 WebSocket API
定义通道,它表示与能够执行 I/O 操作的实体的连接,例如文件和套接字;定义选择器,用于多路复用、非阻塞 I/O 操作。
定义Java虚拟机访问文件、文件属性和文件系统的接口和类。
java.nio.file 包的服务提供商类。
包含集合框架、一些国际化支持类、服务加载器、属性、随机数生成、字符串解析和扫描类、base64 编码和解码、位数组和几个杂项实用程序类。
为可以从程序中调用的工具提供接口,例如编译器。
这个包提供类来创建事件和控制飞行记录器。
此包包含用于使用 Flight Recorder 数据的类。
此包包含通过 Java 管理扩展 (JMX) 控制和监视 Flight Recorder 的类。
-
Path 在 com.sun.net.httpserver 中的用法
com.sun.net.httpserver 中的方法,参数类型为 Path修饰符和类型方法描述static HttpHandlerSimpleFileServer.createFileHandler(Path rootDirectory) 创建一个文件处理程序提供来自给定目录路径(及其子目录)的文件。static HttpServerSimpleFileServer.createFileServer(InetSocketAddress addr, Path rootDirectory, SimpleFileServer.OutputLevel outputLevel) 创建一个文件服务从给定路径提供文件。 -
Path 在 java.io 中的用法
-
Path 在 java.lang.foreign 中的用法
java.lang.foreign 中的方法,参数类型为 Path修饰符和类型方法描述static SymbolLookupPREVIEWSymbolLookup.libraryLookup(Path path, SegmentScopePREVIEW scope) 从给定路径加载库(如果尚未加载)并为该库中的符号创建符号查找。 -
Path 在 java.lang.module 中的用法
java.lang.module 中的方法,参数类型为 Path -
Path 在 java.net 中的用法
-
Path 在 java.net.http 中的用法
返回类型中包含 Path 类型参数的 java.net.http 中的方法修饰符和类型方法描述static HttpResponse.BodyHandler<Path>static HttpResponse.BodyHandler<Path>HttpResponse.BodyHandlers.ofFile(Path file, OpenOption... openOptions) static HttpResponse.BodySubscriber<Path>返回一个BodySubscriber,它将响应主体存储在以给定名称打开的文件中。static HttpResponse.BodySubscriber<Path>HttpResponse.BodySubscribers.ofFile(Path file, OpenOption... openOptions) 返回一个BodySubscriber,它将响应主体存储在使用给定选项和名称打开的文件中。static HttpResponse.BodyHandler<Path>HttpResponse.BodyHandlers.ofFileDownload(Path directory, OpenOption... openOptions) java.net.http 中的方法,参数类型为 Path修饰符和类型方法描述static HttpRequest.BodyPublisher从文件内容中获取数据的请求正文发布者。static HttpResponse.BodyHandler<Path>static HttpResponse.BodyHandler<Path>HttpResponse.BodyHandlers.ofFile(Path file, OpenOption... openOptions) static HttpResponse.BodySubscriber<Path>返回一个BodySubscriber,它将响应主体存储在以给定名称打开的文件中。static HttpResponse.BodySubscriber<Path>HttpResponse.BodySubscribers.ofFile(Path file, OpenOption... openOptions) 返回一个BodySubscriber,它将响应主体存储在使用给定选项和名称打开的文件中。static HttpResponse.BodyHandler<Path>HttpResponse.BodyHandlers.ofFileDownload(Path directory, OpenOption... openOptions) -
Path 在 java.nio.channels 中的用法
java.nio.channels 中的方法,参数类型为 Path修饰符和类型方法描述static AsynchronousFileChannelAsynchronousFileChannel.open(Path file, OpenOption... options) 打开或创建用于读取和/或写入的文件,返回异步文件通道以访问该文件。static AsynchronousFileChannelAsynchronousFileChannel.open(Path file, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs) 打开或创建用于读取和/或写入的文件,返回异步文件通道以访问该文件。static FileChannelFileChannel.open(Path path, OpenOption... options) 打开或创建一个文件,返回一个文件通道来访问该文件。static FileChannelFileChannel.open(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) 打开或创建一个文件,返回一个文件通道来访问该文件。 -
Path 在 java.nio.file 中的用法
java.nio.file 中具有 Path 类型参数的字段修饰符和类型Field描述static final WatchEvent.Kind<Path>StandardWatchEventKinds.ENTRY_CREATE已创建目录条目。static final WatchEvent.Kind<Path>StandardWatchEventKinds.ENTRY_DELETE目录条目已删除。static final WatchEvent.Kind<Path>StandardWatchEventKinds.ENTRY_MODIFY目录条目已修改。java.nio.file 中返回 Path 的方法修饰符和类型方法描述static PathFiles.copy(Path source, Path target, CopyOption... options) 将文件复制到目标文件。static PathFiles.createDirectories(Path dir, FileAttribute<?>... attrs) 通过首先创建所有不存在的父目录来创建目录。static PathFiles.createDirectory(Path dir, FileAttribute<?>... attrs) 创建一个新目录。static PathFiles.createFile(Path path, FileAttribute<?>... attrs) 创建一个新的空文件,如果文件已经存在则失败。static PathFiles.createLink(Path link, Path existing) 为现有文件创建新链接(目录条目)(可选操作).static PathFiles.createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) 创建指向目标的符号链接(可选操作).static PathFiles.createTempDirectory(String prefix, FileAttribute<?>... attrs) 在默认的临时文件目录中创建一个新目录,使用给定的前缀生成其名称。static PathFiles.createTempDirectory(Path dir, String prefix, FileAttribute<?>... attrs) 在指定目录中创建一个新目录,使用给定的前缀生成其名称。static PathFiles.createTempFile(String prefix, String suffix, FileAttribute<?>... attrs) 在默认临时文件目录中创建一个空文件,使用给定的前缀和后缀生成其名称。static PathFiles.createTempFile(Path dir, String prefix, String suffix, FileAttribute<?>... attrs) 在指定目录中创建一个新的空文件,使用给定的前缀和后缀字符串生成其名称。static Path将路径字符串或连接形成路径字符串的字符串序列转换为Path。static Path将给定的 URI 转换为Path对象。Path.getFileName()返回此路径表示的文件或目录的名称作为Path对象。Path.getName(int index) 将此路径的名称元素作为Path对象返回。Path.getParent()如果此路径没有父级,则返回 parent path 或null。abstract Path将路径字符串或连接形成路径字符串的字符串序列转换为Path。Path.getRoot()返回此路径的根组件作为Path对象,或null如果此路径没有根组件。static PathFiles.move(Path source, Path target, CopyOption... options) 将文件移动或重命名为目标文件。Path.normalize()返回一个路径,该路径是删除了冗余名称元素的路径。static Path通过转换路径字符串或连接形成路径字符串的字符串序列返回Path。static Path通过转换 URI 返回一个Path。static PathFiles.readSymbolicLink(Path link) 读取符号链接的目标(可选操作).Path.relativize(Path other) 构造此路径和给定路径之间的相对路径。default Path根据此路径解析给定路径。default PathPath.resolveSibling(String other) default PathPath.resolveSibling(Path other) 根据此路径的parent路径解析给定路径。static PathFiles.setAttribute(Path path, String attribute, Object value, LinkOption... options) 设置文件属性的值。static PathFiles.setLastModifiedTime(Path path, FileTime time) 更新文件的上次修改时间属性。static PathFiles.setOwner(Path path, UserPrincipal owner) 更新文件所有者。static PathFiles.setPosixFilePermissions(Path path, Set<PosixFilePermission> perms) 设置文件的 POSIX 权限。Path.subpath(int beginIndex, int endIndex) 返回一个相对的Path,它是此路径的名称元素的子序列。Path.toAbsolutePath()返回一个代表该路径绝对路径的Path对象。Path.toRealPath(LinkOption... options) 返回现有文件的 real 路径。static PathFiles.walkFileTree(Path start, FileVisitor<? super Path> visitor) 遍历文件树。static PathFiles.walkFileTree(Path start, Set<FileVisitOption> options, int maxDepth, FileVisitor<? super Path> visitor) 遍历文件树。static PathFiles.write(Path path, byte[] bytes, OpenOption... options) 将字节写入文件。static PathFiles.write(Path path, Iterable<? extends CharSequence> lines, Charset cs, OpenOption... options) 将文本行写入文件。static PathFiles.write(Path path, Iterable<? extends CharSequence> lines, OpenOption... options) 将文本行写入文件。static PathFiles.writeString(Path path, CharSequence csq, Charset cs, OpenOption... options) 将 CharSequence 写入文件。static PathFiles.writeString(Path path, CharSequence csq, OpenOption... options) 将 CharSequence 写入文件。返回类型中包含 Path 类型参数的 java.nio.file 中的方法修饰符和类型方法描述Files.find(Path start, int maxDepth, BiPredicate<Path, BasicFileAttributes> matcher, FileVisitOption... options) 通过在以给定起始文件为根的文件树中搜索文件,返回一个用Path延迟填充的Stream。FileSystem.getRootDirectories()返回一个对象以遍历根目录的路径。Path.iterator()返回此路径的名称元素的迭代器。返回一个延迟填充的Stream,其元素是目录中的条目。static DirectoryStream<Path>Files.newDirectoryStream(Path dir) 打开一个目录,返回一个DirectoryStream以遍历目录中的所有条目。static DirectoryStream<Path>Files.newDirectoryStream(Path dir, String glob) 打开一个目录,返回一个DirectoryStream以迭代目录中的条目。static DirectoryStream<Path>Files.newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) 打开一个目录,返回一个DirectoryStream以迭代目录中的条目。Files.walk(Path start, int maxDepth, FileVisitOption... options) 通过遍历以给定起始文件为根的文件树,返回一个用Path延迟填充的Stream。Files.walk(Path start, FileVisitOption... options) 通过遍历以给定起始文件为根的文件树,返回一个用Path延迟填充的Stream。java.nio.file 中的方法,参数类型为 Path修饰符和类型方法描述int按字典顺序比较两个抽象路径。static longFiles.copy(InputStream in, Path target, CopyOption... options) 将输入流中的所有字节复制到文件中。static longFiles.copy(Path source, OutputStream out) 将文件中的所有字节复制到输出流。static PathFiles.copy(Path source, Path target, CopyOption... options) 将文件复制到目标文件。static PathFiles.createDirectories(Path dir, FileAttribute<?>... attrs) 通过首先创建所有不存在的父目录来创建目录。static PathFiles.createDirectory(Path dir, FileAttribute<?>... attrs) 创建一个新目录。static PathFiles.createFile(Path path, FileAttribute<?>... attrs) 创建一个新的空文件,如果文件已经存在则失败。static PathFiles.createLink(Path link, Path existing) 为现有文件创建新链接(目录条目)(可选操作).static PathFiles.createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) 创建指向目标的符号链接(可选操作).static PathFiles.createTempDirectory(Path dir, String prefix, FileAttribute<?>... attrs) 在指定目录中创建一个新目录,使用给定的前缀生成其名称。static PathFiles.createTempFile(Path dir, String prefix, String suffix, FileAttribute<?>... attrs) 在指定目录中创建一个新的空文件,使用给定的前缀和后缀字符串生成其名称。static void删除文件。static booleanFiles.deleteIfExists(Path path) 删除文件(如果存在)。boolean测试此路径是否以给定路径结尾。static booleanFiles.exists(Path path, LinkOption... options) 测试文件是否存在。Files.find(Path start, int maxDepth, BiPredicate<Path, BasicFileAttributes> matcher, FileVisitOption... options) 通过在以给定起始文件为根的文件树中搜索文件,返回一个用Path延迟填充的Stream。static ObjectFiles.getAttribute(Path path, String attribute, LinkOption... options) 读取文件属性的值。static <V extends FileAttributeView>
VFiles.getFileAttributeView(Path path, Class<V> type, LinkOption... options) 返回给定类型的文件属性视图。static FileStoreFiles.getFileStore(Path path) 返回代表文件所在文件存储的FileStore。static FileTimeFiles.getLastModifiedTime(Path path, LinkOption... options) 返回文件的最后修改时间。static UserPrincipalFiles.getOwner(Path path, LinkOption... options) 返回文件的所有者。static Set<PosixFilePermission>Files.getPosixFilePermissions(Path path, LinkOption... options) 返回文件的 POSIX 文件权限。static booleanFiles.isDirectory(Path path, LinkOption... options) 测试文件是否是目录。static booleanFiles.isExecutable(Path path) 测试文件是否可执行。static boolean告知文件是否被视为 hidden 。static booleanFiles.isReadable(Path path) 测试文件是否可读。static booleanFiles.isRegularFile(Path path, LinkOption... options) 测试文件是否是具有不透明内容的常规文件。static booleanFiles.isSameFile(Path path, Path path2) 测试两个路径是否找到同一个文件。static booleanFiles.isSymbolicLink(Path path) 测试文件是否为符号链接。static booleanFiles.isWritable(Path path) 测试文件是否可写。从文件中读取所有行作为Stream。从文件中读取所有行作为Stream。返回一个延迟填充的Stream,其元素是目录中的条目。boolean判断给定路径是否匹配此匹配器的模式。static long查找并返回两个文件内容中第一个不匹配字节的位置,如果不匹配则返回-1L。static PathFiles.move(Path source, Path target, CopyOption... options) 将文件移动或重命名为目标文件。static BufferedReaderFiles.newBufferedReader(Path path) 打开一个文件进行读取,返回一个BufferedReader以高效的方式从文件中读取文本。static BufferedReaderFiles.newBufferedReader(Path path, Charset cs) 打开一个文件进行读取,返回一个BufferedReader可用于以有效的方式从文件中读取文本。static BufferedWriterFiles.newBufferedWriter(Path path, Charset cs, OpenOption... options) 打开或创建一个用于写入的文件,返回一个BufferedWriter可用于以有效的方式将文本写入文件。static BufferedWriterFiles.newBufferedWriter(Path path, OpenOption... options) 打开或创建用于写入的文件,返回BufferedWriter以高效方式将文本写入文件。static SeekableByteChannelFiles.newByteChannel(Path path, OpenOption... options) 打开或创建一个文件,返回一个可搜索的字节通道来访问该文件。static SeekableByteChannelFiles.newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) 打开或创建一个文件,返回一个可搜索的字节通道来访问该文件。static DirectoryStream<Path>Files.newDirectoryStream(Path dir) 打开一个目录,返回一个DirectoryStream以遍历目录中的所有条目。static DirectoryStream<Path>Files.newDirectoryStream(Path dir, String glob) 打开一个目录,返回一个DirectoryStream以迭代目录中的条目。static DirectoryStream<Path>Files.newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) 打开一个目录,返回一个DirectoryStream以迭代目录中的条目。static FileSystemFileSystems.newFileSystem(Path path) 构造一个新的FileSystem来访问文件的内容作为文件系统。static FileSystemFileSystems.newFileSystem(Path path, ClassLoader loader) 构造一个新的FileSystem来访问文件的内容作为文件系统。static FileSystemFileSystems.newFileSystem(Path path, Map<String, ?> env) 构造一个新的FileSystem来访问文件的内容作为文件系统。static FileSystemFileSystems.newFileSystem(Path path, Map<String, ?> env, ClassLoader loader) 构造一个新的FileSystem来访问文件的内容作为文件系统。static InputStreamFiles.newInputStream(Path path, OpenOption... options) 打开一个文件,返回一个输入流以从文件中读取。static OutputStreamFiles.newOutputStream(Path path, OpenOption... options) 打开或创建文件,返回可用于将字节写入文件的输出流。static booleanFiles.notExists(Path path, LinkOption... options) 测试此路径所在的文件是否不存在。static StringFiles.probeContentType(Path path) 探测文件的内容类型。static byte[]Files.readAllBytes(Path path) 从文件中读取所有字节。Files.readAllLines(Path path) 从文件中读取所有行。Files.readAllLines(Path path, Charset cs) 从文件中读取所有行。static <A extends BasicFileAttributes>
AFiles.readAttributes(Path path, Class<A> type, LinkOption... options) 作为批量操作读取文件的属性。Files.readAttributes(Path path, String attributes, LinkOption... options) 读取一组文件属性作为批量操作。static StringFiles.readString(Path path) static StringFiles.readString(Path path, Charset cs) 将文件中的所有字符读入字符串,使用指定的 charset 从字节解码为字符。static PathFiles.readSymbolicLink(Path link) 读取符号链接的目标(可选操作).Path.relativize(Path other) 构造此路径和给定路径之间的相对路径。根据此路径解析给定路径。default PathPath.resolveSibling(Path other) 根据此路径的parent路径解析给定路径。static PathFiles.setAttribute(Path path, String attribute, Object value, LinkOption... options) 设置文件属性的值。static PathFiles.setLastModifiedTime(Path path, FileTime time) 更新文件的上次修改时间属性。static PathFiles.setOwner(Path path, UserPrincipal owner) 更新文件所有者。static PathFiles.setPosixFilePermissions(Path path, Set<PosixFilePermission> perms) 设置文件的 POSIX 权限。static long返回文件的大小(以字节为单位)。booleanPath.startsWith(Path other) 测试此路径是否以给定路径开头。Files.walk(Path start, int maxDepth, FileVisitOption... options) 通过遍历以给定起始文件为根的文件树,返回一个用Path延迟填充的Stream。Files.walk(Path start, FileVisitOption... options) 通过遍历以给定起始文件为根的文件树,返回一个用Path延迟填充的Stream。static PathFiles.walkFileTree(Path start, FileVisitor<? super Path> visitor) 遍历文件树。static PathFiles.walkFileTree(Path start, Set<FileVisitOption> options, int maxDepth, FileVisitor<? super Path> visitor) 遍历文件树。static PathFiles.write(Path path, byte[] bytes, OpenOption... options) 将字节写入文件。static PathFiles.write(Path path, Iterable<? extends CharSequence> lines, Charset cs, OpenOption... options) 将文本行写入文件。static PathFiles.write(Path path, Iterable<? extends CharSequence> lines, OpenOption... options) 将文本行写入文件。static PathFiles.writeString(Path path, CharSequence csq, Charset cs, OpenOption... options) 将 CharSequence 写入文件。static PathFiles.writeString(Path path, CharSequence csq, OpenOption... options) 将 CharSequence 写入文件。java.nio.file 中的方法参数,类型参数为 Path修饰符和类型方法描述Files.find(Path start, int maxDepth, BiPredicate<Path, BasicFileAttributes> matcher, FileVisitOption... options) 通过在以给定起始文件为根的文件树中搜索文件,返回一个用Path延迟填充的Stream。static DirectoryStream<Path>Files.newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) 打开一个目录,返回一个DirectoryStream以迭代目录中的条目。static PathFiles.walkFileTree(Path start, FileVisitor<? super Path> visitor) 遍历文件树。static PathFiles.walkFileTree(Path start, Set<FileVisitOption> options, int maxDepth, FileVisitor<? super Path> visitor) 遍历文件树。 -
Path 在 java.nio.file.spi 中的用法
java.nio.file.spi 中返回 Path 的方法修饰符和类型方法描述abstract Path通过转换给定的URI返回一个Path对象。FileSystemProvider.readSymbolicLink(Path link) 读取符号链接的目标。返回类型中包含 Path 类型参数的 java.nio.file.spi 中的方法修饰符和类型方法描述abstract DirectoryStream<Path>FileSystemProvider.newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) 打开一个目录,返回一个DirectoryStream以迭代目录中的条目。java.nio.file.spi 中的方法,参数类型为 Path修饰符和类型方法描述abstract voidFileSystemProvider.checkAccess(Path path, AccessMode... modes) 检查文件是否存在,并可选地检查文件的可访问性。abstract voidFileSystemProvider.copy(Path source, Path target, CopyOption... options) 将文件复制到目标文件。abstract voidFileSystemProvider.createDirectory(Path dir, FileAttribute<?>... attrs) 创建一个新目录。voidFileSystemProvider.createLink(Path link, Path existing) 为现有文件创建新链接(目录条目)。voidFileSystemProvider.createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) 创建指向目标的符号链接。abstract void删除文件。booleanFileSystemProvider.deleteIfExists(Path path) 删除文件(如果存在)。booleanFileSystemProvider.exists(Path path, LinkOption... options) 测试文件是否存在。abstract <V extends FileAttributeView>
VFileSystemProvider.getFileAttributeView(Path path, Class<V> type, LinkOption... options) 返回给定类型的文件属性视图。abstract FileStoreFileSystemProvider.getFileStore(Path path) 返回代表文件所在文件存储的FileStore。abstract boolean告知文件是否被视为 hidden 。abstract booleanFileSystemProvider.isSameFile(Path path, Path path2) 测试两个路径是否找到同一个文件。abstract voidFileSystemProvider.move(Path source, Path target, CopyOption... options) 将文件移动或重命名为目标文件。FileSystemProvider.newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs) 打开或创建用于读取和/或写入的文件,返回异步文件通道以访问该文件。abstract SeekableByteChannelFileSystemProvider.newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) 打开或创建一个文件,返回一个可搜索的字节通道来访问该文件。abstract DirectoryStream<Path>FileSystemProvider.newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) 打开一个目录,返回一个DirectoryStream以迭代目录中的条目。FileSystemProvider.newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) 打开或创建用于读取和/或写入的文件,返回文件通道以访问该文件。FileSystemProvider.newFileSystem(Path path, Map<String, ?> env) 构造一个新的FileSystem来访问文件的内容作为文件系统。FileSystemProvider.newInputStream(Path path, OpenOption... options) 打开一个文件,返回一个输入流以从文件中读取。FileSystemProvider.newOutputStream(Path path, OpenOption... options) 打开或创建文件,返回可用于将字节写入文件的输出流。abstract StringFileTypeDetector.probeContentType(Path path) 探测给定文件以猜测其内容类型。abstract <A extends BasicFileAttributes>
AFileSystemProvider.readAttributes(Path path, Class<A> type, LinkOption... options) 作为批量操作读取文件的属性。FileSystemProvider.readAttributes(Path path, String attributes, LinkOption... options) 读取一组文件属性作为批量操作。<A extends BasicFileAttributes>
AFileSystemProvider.readAttributesIfExists(Path path, Class<A> type, LinkOption... options) 如果文件存在,则将文件的属性作为批量操作读取。FileSystemProvider.readSymbolicLink(Path link) 读取符号链接的目标。abstract voidFileSystemProvider.setAttribute(Path path, String attribute, Object value, LinkOption... options) 设置文件属性的值。java.nio.file.spi 中的方法参数,类型参数为 Path修饰符和类型方法描述abstract DirectoryStream<Path>FileSystemProvider.newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) 打开一个目录,返回一个DirectoryStream以迭代目录中的条目。 -
Path 在 java.util 中的用法
-
Path 在 javax.tools 中的用法
javax.tools 中返回 Path 的方法修饰符和类型方法描述default PathStandardJavaFileManager.asPath(FileObject file) 返回此文件对象的路径(如果有)(可选操作)。将路径字符串或连接形成路径字符串的字符串序列转换为路径。返回类型中包含 Path 类型参数的 javax.tools 中的方法修饰符和类型方法描述StandardJavaFileManager.getLocationAsPaths(JavaFileManager.Location location) 返回与给定位置关联的搜索路径。javax.tools 中的方法,参数类型为 Path修饰符和类型方法描述default Iterable<? extends JavaFileObject>StandardJavaFileManager.getJavaFileObjects(Path... paths) 返回表示给定路径的文件对象。javax.tools 中的方法参数,类型参数为 Path修饰符和类型方法描述default Iterable<? extends JavaFileObject>StandardJavaFileManager.getJavaFileObjectsFromPaths(Iterable<? extends Path> paths) 已弃用。default Iterable<? extends JavaFileObject>StandardJavaFileManager.getJavaFileObjectsFromPaths(Collection<? extends Path> paths) 返回表示给定路径的文件对象。default voidStandardJavaFileManager.setLocationForModule(JavaFileManager.Location location, String moduleName, Collection<? extends Path> paths) 将给定的搜索路径与给定的模块和位置相关联,该模块和位置必须是面向模块的或输出位置。default voidStandardJavaFileManager.setLocationFromPaths(JavaFileManager.Location location, Collection<? extends Path> paths) 将给定的搜索路径与给定的位置相关联。 -
Path 在 jdk.jfr 中的用法
修饰符和类型方法描述static Configuration从文件中读取配置。void将录音数据写入文件。voidRecording.setDestination(Path destination) 设置记录停止时写入数据的位置,如果不转储数据,则设置为null。 -
Path 在 jdk.jfr.consumer 中的用法
jdk.jfr.consumer 中的方法,参数类型为 Path修饰符和类型方法描述void将录音数据写入文件。static EventStream从文件创建事件流。static EventStreamEventStream.openRepository(Path directory) 从磁盘存储库创建事件流。static List<RecordedEvent>RecordingFile.readAllEvents(Path path) 返回文件中所有事件的列表。voidRecordingFile.write(Path destination, Predicate<RecordedEvent> filter) 过滤掉事件并将它们写入新文件。jdk.jfr.consumer 中的构造函数,参数类型为 Path -
Path 在 jdk.management.jfr 中的用法
jdk.management.jfr 中的方法,参数类型为 Pathjdk.management.jfr 中的构造函数,参数类型为 Path修饰符构造方法描述RemoteRecordingStream(MBeanServerConnection connection, Path directory) 创建针对已注册FlightRecorderMXBean的MBeanServerConnection进行操作的事件流。
StandardJavaFileManager.getJavaFileObjectsFromPaths(Collection),以防止使用单个Path作为此类参数意外调用该方法的可能性。