软件包 | 描述 |
---|---|
java.nio.file |
定义的接口和类的java虚拟机访问文件,文件属性,文件系统。
|
java.nio.file.spi |
为
java.nio.file 包服务提供商类。
|
Modifier and Type | Method and Description |
---|---|
static LinkOption |
LinkOption.valueOf(String name)
返回此类型具有指定名称的枚举常量。
|
static LinkOption[] |
LinkOption.values()
返回一个数组包含该枚举类型的常量,它们的顺序声明。
|
Modifier and Type | Method and Description |
---|---|
static boolean |
Files.exists(Path path, LinkOption... options)
测试一个文件是否存在。
|
static Object |
Files.getAttribute(Path path, String attribute, LinkOption... options)
读取文件属性的值。
|
static <V extends FileAttributeView> |
Files.getFileAttributeView(Path path, 类<V> type, LinkOption... options)
返回一个给定类型的文件属性视图。
|
<V extends FileAttributeView> |
SecureDirectoryStream.getFileAttributeView(T path, 类<V> type, LinkOption... options)
返回一个新的文件属性视图以访问该目录中的文件的文件属性。
|
static FileTime |
Files.getLastModifiedTime(Path path, LinkOption... options)
返回一个文件的最后修改时间。
|
static UserPrincipal |
Files.getOwner(Path path, LinkOption... options)
返回文件的所有者。
|
static Set<PosixFilePermission> |
Files.getPosixFilePermissions(Path path, LinkOption... options)
返回一个文件的POSIX文件权限。
|
static boolean |
Files.isDirectory(Path path, LinkOption... options)
测试一个文件是否是一个目录。
|
static boolean |
Files.isRegularFile(Path path, LinkOption... options)
测试一个文件是否是一个不透明的内容的常规文件。
|
SecureDirectoryStream<T> |
SecureDirectoryStream.newDirectoryStream(T path, LinkOption... options)
打开目录给出的路径确定,返回一个
SecureDirectoryStream 遍历目录中的条目。
|
static boolean |
Files.notExists(Path path, LinkOption... options)
测试位于此路径的文件是否不存在。
|
static <A extends BasicFileAttributes> |
Files.readAttributes(Path path, 类<A> type, LinkOption... options)
读取一个文件的属性作为一个批量操作。
|
static Map<String,Object> |
Files.readAttributes(Path path, String attributes, LinkOption... options)
读取一组文件属性作为批量操作。
|
static Path |
Files.setAttribute(Path path, String attribute, Object value, LinkOption... options)
设置文件属性的值。
|
Path |
Path.toRealPath(LinkOption... options)
返回一个现有文件的真正路径。
|
Modifier and Type | Method and Description |
---|---|
abstract <V extends FileAttributeView> |
FileSystemProvider.getFileAttributeView(Path path, 类<V> type, LinkOption... options)
返回一个给定类型的文件属性视图。
|
abstract <A extends BasicFileAttributes> |
FileSystemProvider.readAttributes(Path path, 类<A> type, LinkOption... options)
读取一个文件的属性作为一个批量操作。
|
abstract Map<String,Object> |
FileSystemProvider.readAttributes(Path path, String attributes, LinkOption... options)
读取一组文件属性作为批量操作。
|
abstract void |
FileSystemProvider.setAttribute(Path path, String attribute, Object value, LinkOption... options)
设置文件属性的值。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.