IBasicFileAttributeView 接口
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
文件属性视图,提供许多文件系统通用的基本文件属性 集 的视图。
[Android.Runtime.Register("java/nio/file/attribute/BasicFileAttributeView", "", "Java.Nio.FileNio.Attributes.IBasicFileAttributeViewInvoker", ApiSince=26)]
public interface IBasicFileAttributeView : IDisposable, Java.Interop.IJavaPeerable, Java.Nio.FileNio.Attributes.IFileAttributeView
[<Android.Runtime.Register("java/nio/file/attribute/BasicFileAttributeView", "", "Java.Nio.FileNio.Attributes.IBasicFileAttributeViewInvoker", ApiSince=26)>]
type IBasicFileAttributeView = interface
interface IFileAttributeView
interface IAttributeView
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- 派生
- 特性
- 实现
注解
文件属性视图,提供许多文件系统通用的基本文件属性 集 的视图。 基本文件属性集由接口定义的BasicFileAttributes必需和可选文件属性组成。
通过调用#readAttributes() readAttributes该方法,从文件系统检索文件属性作为大容量操作。 此类还定义了 #setTimes setTimes 更新文件的时间属性的方法。
如果需要动态访问文件属性,则此属性视图支持的属性具有以下名称和类型:<blockquote><table class=“striped”><caption style=“display:none”>Supported attributes</caption><thead><tr><th scope=“col”> Name </th><scope=“col”> Type </th></tr></thead><tbody><tr><th scope=“row”>lastModifiedTime“ </th><td/td>FileTime<></tr><th><scope=”row“ ”lastAccessTime“ >< /th><td/td>FileTime<></tr><tr><th scope=”row“> ”creationTime“ </th><td>FileTime</td></tr><tr><th scope=”row“ ”size“ >< /th><td>Long</td></tr><><th scope=“row”> “isRegularFile” </th td/td><>Boolean</tr><tr><th><scope=“row” “isDirectory” >< /th><td/td>Boolean<></><tr><th scope=“row”> “isSymbolicLink” </th><td/td>Boolean<></tr tr><><th scope=“row”> “isOther” </th><td>Boolean</td></tr><tr><th scope=“row” “fileKey” >< /th><td/td>Object<></tr></tbody></table></blockquote>
该方法 java.nio.file.Files#getAttribute getAttribute 可用于读取这些属性中的任何一个,就好像通过调用 #readAttributes() readAttributes() 该方法一样。
该方法 java.nio.file.Files#setAttribute setAttribute 可用于更新文件的上次修改时间、上次访问时间或创建时间属性,就像调用该方法一 #setTimes setTimes 样。
已在 1.7 中添加。
Java文档java.nio.file.attribute.BasicFileAttributeView。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
属性
| 名称 | 说明 |
|---|---|
| Handle |
获取基础 Android 对象的 JNI 值。 (继承自 IJavaObject) |
| JniIdentityHashCode |
返回包装实例的值 |
| JniManagedPeerState |
托管对等方的状态。 (继承自 IJavaPeerable) |
| JniObjectReferenceControlBlock |
获取特定于实现的 JNI 引用控制块指针。 (继承自 IJavaPeerable) |
| JniPeerMembers |
成员访问和调用支持。 (继承自 IJavaPeerable) |
| PeerReference |
返回JniObjectReference包装的Java对象实例。 (继承自 IJavaPeerable) |
方法
| 名称 | 说明 |
|---|---|
| Disposed() |
在释放实例时调用。 (继承自 IJavaPeerable) |
| DisposeUnlessReferenced() |
如果没有对此实例的未完成引用,则调用 |
| Finalized() |
在实例完成时调用。 (继承自 IJavaPeerable) |
| Name() |
返回属性视图的名称。 |
| ReadAttributes() |
将基本文件属性作为批量操作读取。 |
| SetJniIdentityHashCode(Int32) |
设置由 |
| SetJniManagedPeerState(JniManagedPeerStates) |
设置由 |
| SetPeerReference(JniObjectReference) |
设置由 |
| SetTimes(FileTime, FileTime, FileTime) |
更新文件上次修改时间、上次访问时间以及创建时间属性的任何或全部。 |
| UnregisterFromRuntime() |
取消注册此实例,使运行时不会从将来 Java.Interop.JniRuntime+JniValueManager.PeekValue 的调用中返回它。 (继承自 IJavaPeerable) |
扩展方法
| 名称 | 说明 |
|---|---|
| GetJniTypeName(IJavaPeerable) |
获取实例 |
| JavaAs<TResult>(IJavaPeerable) |
尝试强制 |
| JavaCast<TResult>(IJavaObject) |
执行 Android 运行时检查的类型转换。 |
| JavaCast<TResult>(IJavaObject) |
重复使用兼容的托管对等,或获取请求类型的包装器。 |
| TryJavaCast<TResult>(IJavaPeerable, TResult) |
尝试强制 |