-
Notifications
You must be signed in to change notification settings - Fork 0
/
IPosixFileAttributeView.xml
327 lines (326 loc) · 23.2 KB
/
IPosixFileAttributeView.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<Type Name="IPosixFileAttributeView" FullName="Java.Nio.FileNio.Attributes.IPosixFileAttributeView">
<TypeSignature Language="C#" Value="public interface IPosixFileAttributeView : IDisposable, Java.Interop.IJavaPeerable, Java.Nio.FileNio.Attributes.IBasicFileAttributeView, Java.Nio.FileNio.Attributes.IFileOwnerAttributeView" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract beforefieldinit IPosixFileAttributeView implements class Android.Runtime.IJavaObject, class Java.Interop.IJavaPeerable, class Java.Nio.FileNio.Attributes.IAttributeView, class Java.Nio.FileNio.Attributes.IBasicFileAttributeView, class Java.Nio.FileNio.Attributes.IFileAttributeView, class Java.Nio.FileNio.Attributes.IFileOwnerAttributeView, class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:Java.Nio.FileNio.Attributes.IPosixFileAttributeView" />
<TypeSignature Language="F#" Value="type IPosixFileAttributeView = interface
 interface IBasicFileAttributeView
 interface IFileAttributeView
 interface IAttributeView
 interface IJavaObject
 interface IDisposable
 interface IJavaPeerable
 interface IFileOwnerAttributeView" />
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Interfaces>
<Interface>
<InterfaceName>Android.Runtime.IJavaObject</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Interop.IJavaPeerable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Nio.FileNio.Attributes.IAttributeView</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Nio.FileNio.Attributes.IBasicFileAttributeView</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Nio.FileNio.Attributes.IFileAttributeView</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Java.Nio.FileNio.Attributes.IFileOwnerAttributeView</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("java/nio/file/attribute/PosixFileAttributeView", "", "Java.Nio.FileNio.Attributes.IPosixFileAttributeViewInvoker", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("java/nio/file/attribute/PosixFileAttributeView", "", "Java.Nio.FileNio.Attributes.IPosixFileAttributeViewInvoker", ApiSince=26)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>A file attribute view that provides a view of the file attributes commonly
associated with files on file systems used by operating systems that implement
the Portable Operating System Interface (POSIX) family of standards.</summary>
<remarks>
<para>A file attribute view that provides a view of the file attributes commonly
associated with files on file systems used by operating systems that implement
the Portable Operating System Interface (POSIX) family of standards.</para>
<para>Operating systems that implement the <see href="http://www.opengroup.org">
POSIX</see> family of standards commonly use file systems that have a
file <em>owner</em>, <em>group-owner</em>, and related <em>access
permissions</em>. This file attribute view provides read and write access
to these attributes.</para>
<para>The <c>#readAttributes() readAttributes</c> method is used to read the
file's attributes. The file <c>PosixFileAttributes#owner() owner</c> is
represented by a <c>UserPrincipal</c> that is the identity of the file owner
for the purposes of access control. The <c>PosixFileAttributes#group()
group-owner</c>, represented by a <c>GroupPrincipal</c>, is the identity of the
group owner, where a group is an identity created for administrative purposes
so as to determine the access rights for the members of the group.</para>
<para>The <c>PosixFileAttributes#permissions() permissions</c> attribute is a
set of access permissions. This file attribute view provides access to the nine
permission defined by the <c>PosixFilePermission</c> class.
These nine permission bits determine the <em>read</em>, <em>write</em>, and
<em>execute</em> access for the file owner, group, and others (others
meaning identities other than the owner and members of the group). Some
operating systems and file systems may provide additional permission bits
but access to these other bits is not defined by this class in this release.</para>
<para><b>Usage Example:</b>
Suppose we need to print out the owner and access permissions of a file:</para>
<code lang="text/java">Path file = ...
PosixFileAttributes attrs = Files.getFileAttributeView(file, PosixFileAttributeView.class)
.readAttributes();
System.out.format("%s %s%n",
attrs.owner().getName(),
PosixFilePermissions.toString(attrs.permissions()));
</code>
<para><h2> Dynamic Access </h2></para>
<para>Where dynamic access to file attributes is required, the attributes
supported by this attribute view are as defined by <c>BasicFileAttributeView</c> and <c>FileOwnerAttributeView</c>, and in addition,
the following attributes are supported:
<blockquote>
<table class="striped">
<caption style="display:none">Supported attributes</caption>
<thead>
<tr>
<th scope="col"> Name </th>
<th scope="col"> Type </th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"> "permissions" </th>
<td> <c>Set</c>&lt;<c>PosixFilePermission</c>&gt; </td>
</tr>
<tr>
<th scope="row"> "group" </th>
<td> <c>GroupPrincipal</c></td>
</tr>
</tbody>
</table>
</blockquote></para>
<para>The <c>Files#getAttribute getAttribute</c> method may be used to read
any of these attributes, or any of the attributes defined by <c>BasicFileAttributeView</c> as if by invoking the <c>#readAttributes
readAttributes()</c> method.</para>
<para>The <c>Files#setAttribute setAttribute</c> method may be used to update
the file's last modified time, last access time or create time attributes as
defined by <c>BasicFileAttributeView</c>. It may also be used to update
the permissions, owner, or group-owner as if by invoking the <c>#setPermissions setPermissions</c>, <c>#setOwner setOwner</c>, and <c>#setGroup setGroup</c> methods respectively.
<h2> Setting Initial Permissions </h2></para>
<para>Implementations supporting this attribute view may also support setting
the initial permissions when creating a file or directory. The
initial permissions are provided to the <c>Files#createFile createFile</c>
or <c>Files#createDirectory createDirectory</c> methods as a <c>FileAttribute</c> with <c>FileAttribute#name name</c><c>"posix:permissions"</c>
and a <c>FileAttribute#value value</c> that is the set of permissions. The
following example uses the <c>PosixFilePermissions#asFileAttribute
asFileAttribute</c> method to construct a <c>FileAttribute</c> when creating a
file:</para>
<code lang="text/java">Path path = ...
Set&lt;PosixFilePermission&gt; perms =
EnumSet.of(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, GROUP_READ);
Files.createFile(path, PosixFilePermissions.asFileAttribute(perms));
</code>
<para>When the access permissions are set at file creation time then the actual
value of the permissions may differ that the value of the attribute object.
The reasons for this are implementation specific. On UNIX systems, for
example, a process has a <em>umask</em> that impacts the permission bits
of newly created files. Where an implementation supports the setting of
the access permissions, and the underlying file system supports access
permissions, then it is required that the value of the actual access
permissions will be equal or less than the value of the attribute
provided to the <c>Files#createFile createFile</c> or <c>Files#createDirectory createDirectory</c> methods. In other words, the file may
be more secure than requested.</para>
<para>Added in 1.7.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/PosixFileAttributeView" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.PosixFileAttributeView</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
<Members>
<Member MemberName="Name">
<MemberSignature Language="C#" Value="public string? Name ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string Name() cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.Attributes.IPosixFileAttributeView.Name" />
<MemberSignature Language="F#" Value="abstract member Name : unit -> string" Usage="iPosixFileAttributeView.Name " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:Java.Nio.FileNio.Attributes.IBasicFileAttributeView.Name</InterfaceMember>
<InterfaceMember>M:Java.Nio.FileNio.Attributes.IFileOwnerAttributeView.Name</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("name", "()Ljava/lang/String;", "GetNameHandler:Java.Nio.FileNio.Attributes.IPosixFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("name", "()Ljava/lang/String;", "GetNameHandler:Java.Nio.FileNio.Attributes.IPosixFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the name of the attribute view.</summary>
<returns>To be added.</returns>
<remarks>
<para>Returns the name of the attribute view. Attribute views of this type
have the name <c>"posix"</c>.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/PosixFileAttributeView#name()" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.PosixFileAttributeView.name()</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
<Member MemberName="ReadAttributes">
<MemberSignature Language="C#" Value="public Java.Nio.FileNio.Attributes.IBasicFileAttributes? ReadAttributes ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Java.Nio.FileNio.Attributes.IBasicFileAttributes ReadAttributes() cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.Attributes.IPosixFileAttributeView.ReadAttributes" />
<MemberSignature Language="F#" Value="abstract member ReadAttributes : unit -> Java.Nio.FileNio.Attributes.IBasicFileAttributes" Usage="iPosixFileAttributeView.ReadAttributes " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:Java.Nio.FileNio.Attributes.IBasicFileAttributeView.ReadAttributes</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("readAttributes", "()Ljava/nio/file/attribute/PosixFileAttributes;", "GetReadAttributesHandler:Java.Nio.FileNio.Attributes.IPosixFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("readAttributes", "()Ljava/nio/file/attribute/PosixFileAttributes;", "GetReadAttributesHandler:Java.Nio.FileNio.Attributes.IPosixFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>Java.Nio.FileNio.Attributes.IBasicFileAttributes</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/PosixFileAttributeView#readAttributes()" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.PosixFileAttributeView.readAttributes()</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
<Member MemberName="SetGroup">
<MemberSignature Language="C#" Value="public void SetGroup (Java.Nio.FileNio.Attributes.IGroupPrincipal? group);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void SetGroup(class Java.Nio.FileNio.Attributes.IGroupPrincipal group) cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.Attributes.IPosixFileAttributeView.SetGroup(Java.Nio.FileNio.Attributes.IGroupPrincipal)" />
<MemberSignature Language="F#" Value="abstract member SetGroup : Java.Nio.FileNio.Attributes.IGroupPrincipal -> unit" Usage="iPosixFileAttributeView.SetGroup group" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("setGroup", "(Ljava/nio/file/attribute/GroupPrincipal;)V", "GetSetGroup_Ljava_nio_file_attribute_GroupPrincipal_Handler:Java.Nio.FileNio.Attributes.IPosixFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("setGroup", "(Ljava/nio/file/attribute/GroupPrincipal;)V", "GetSetGroup_Ljava_nio_file_attribute_GroupPrincipal_Handler:Java.Nio.FileNio.Attributes.IPosixFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="group" Type="Java.Nio.FileNio.Attributes.IGroupPrincipal" />
</Parameters>
<Docs>
<param name="group">the new file group-owner</param>
<summary>Updates the file group-owner.</summary>
<remarks>
<para>Updates the file group-owner.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/PosixFileAttributeView#setGroup(java.nio.file.attribute.GroupPrincipal)" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.PosixFileAttributeView.setGroup(java.nio.file.attribute.GroupPrincipal)</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
<Member MemberName="SetPermissions">
<MemberSignature Language="C#" Value="public void SetPermissions (System.Collections.Generic.ICollection<Java.Nio.FileNio.Attributes.PosixFilePermission>? perms);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void SetPermissions(class System.Collections.Generic.ICollection`1<class Java.Nio.FileNio.Attributes.PosixFilePermission> perms) cil managed" />
<MemberSignature Language="DocId" Value="M:Java.Nio.FileNio.Attributes.IPosixFileAttributeView.SetPermissions(System.Collections.Generic.ICollection{Java.Nio.FileNio.Attributes.PosixFilePermission})" />
<MemberSignature Language="F#" Value="abstract member SetPermissions : System.Collections.Generic.ICollection<Java.Nio.FileNio.Attributes.PosixFilePermission> -> unit" Usage="iPosixFileAttributeView.SetPermissions perms" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[Android.Runtime.Register("setPermissions", "(Ljava/util/Set;)V", "GetSetPermissions_Ljava_util_Set_Handler:Java.Nio.FileNio.Attributes.IPosixFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("setPermissions", "(Ljava/util/Set;)V", "GetSetPermissions_Ljava_util_Set_Handler:Java.Nio.FileNio.Attributes.IPosixFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="perms" Type="System.Collections.Generic.ICollection<Java.Nio.FileNio.Attributes.PosixFilePermission>" />
</Parameters>
<Docs>
<param name="perms">the new set of permissions</param>
<summary>Updates the file permissions.</summary>
<remarks>
<para>Updates the file permissions.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/PosixFileAttributeView#setPermissions(java.util.Set%3Cjava.nio.file.attribute.PosixFilePermission%3E)" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.PosixFileAttributeView.setPermissions(java.util.Set<java.nio.file.attribute.PosixFilePermission>)</code>.</a>
</format>
</para>
<para>
Portions of this page are modifications based on work created and shared by the
<format type="text/html"><a href="https://developers.google.com/terms/site-policies" title="Android Open Source Project">Android Open Source Project</a></format>
and used according to terms described in the
<format type="text/html"><a href="https://creativecommons.org/licenses/by/2.5/" title="Creative Commons 2.5 Attribution License">Creative Commons 2.5 Attribution License.</a></format></para>
</remarks>
</Docs>
</Member>
</Members>
</Type>