枚举类的使用
java.nio.file.LinkOption
使用 LinkOption 的包
-
LinkOption 在 java.nio.file 中的用法
java.nio.file 中返回 LinkOption 的方法修饰符和类型方法描述static LinkOption返回具有指定名称的此类的枚举常量。static LinkOption[]LinkOption.values()返回一个数组,其中包含此枚举类的常量,按照它们声明的顺序排列。java.nio.file 中的方法,参数类型为 LinkOption修饰符和类型方法描述static booleanFiles.exists(Path path, LinkOption... options) 测试文件是否存在。static ObjectFiles.getAttribute(Path path, String attribute, LinkOption... options) 读取文件属性的值。static <V extends FileAttributeView>
VFiles.getFileAttributeView(Path path, Class<V> type, LinkOption... options) 返回给定类型的文件属性视图。<V extends FileAttributeView>
VSecureDirectoryStream.getFileAttributeView(T path, Class<V> type, LinkOption... options) 返回一个新的文件属性视图以访问此目录中文件的文件属性。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.isRegularFile(Path path, LinkOption... options) 测试文件是否是具有不透明内容的常规文件。SecureDirectoryStream.newDirectoryStream(T path, LinkOption... options) 打开由给定路径标识的目录,返回SecureDirectoryStream以迭代目录中的条目。static booleanFiles.notExists(Path path, LinkOption... options) 测试此路径所在的文件是否不存在。static <A extends BasicFileAttributes>
AFiles.readAttributes(Path path, Class<A> type, LinkOption... options) 作为批量操作读取文件的属性。Files.readAttributes(Path path, String attributes, LinkOption... options) 读取一组文件属性作为批量操作。static PathFiles.setAttribute(Path path, String attribute, Object value, LinkOption... options) 设置文件属性的值。Path.toRealPath(LinkOption... options) 返回现有文件的 real 路径。 -
LinkOption 在 java.nio.file.spi 中的用法
java.nio.file.spi 中的方法,参数类型为 LinkOption修饰符和类型方法描述booleanFileSystemProvider.exists(Path path, LinkOption... options) 测试文件是否存在。abstract <V extends FileAttributeView>
VFileSystemProvider.getFileAttributeView(Path path, Class<V> type, LinkOption... options) 返回给定类型的文件属性视图。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) 如果文件存在,则将文件的属性作为批量操作读取。abstract voidFileSystemProvider.setAttribute(Path path, String attribute, Object value, LinkOption... options) 设置文件属性的值。