-
Notifications
You must be signed in to change notification settings - Fork 0
/
IAclFileAttributeView.xml
232 lines (226 loc) · 15.7 KB
/
IAclFileAttributeView.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
<Type Name="IAclFileAttributeView" FullName="Java.Nio.FileNio.Attributes.IAclFileAttributeView">
<TypeSignature Language="C#" Value="public interface IAclFileAttributeView : IDisposable, Java.Interop.IJavaPeerable, Java.Nio.FileNio.Attributes.IFileOwnerAttributeView" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract beforefieldinit IAclFileAttributeView implements class Android.Runtime.IJavaObject, class Java.Interop.IJavaPeerable, class Java.Nio.FileNio.Attributes.IAttributeView, class Java.Nio.FileNio.Attributes.IFileAttributeView, class Java.Nio.FileNio.Attributes.IFileOwnerAttributeView, class System.IDisposable" />
<TypeSignature Language="DocId" Value="T:Java.Nio.FileNio.Attributes.IAclFileAttributeView" />
<TypeSignature Language="F#" Value="type IAclFileAttributeView = interface
 interface IFileOwnerAttributeView
 interface IFileAttributeView
 interface IAttributeView
 interface IJavaObject
 interface IDisposable
 interface IJavaPeerable" />
<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.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/AclFileAttributeView", "", "Java.Nio.FileNio.Attributes.IAclFileAttributeViewInvoker", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<Android.Runtime.Register("java/nio/file/attribute/AclFileAttributeView", "", "Java.Nio.FileNio.Attributes.IAclFileAttributeViewInvoker", ApiSince=26)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>A file attribute view that supports reading or updating a file's Access
Control Lists (ACL) or file owner attributes.</summary>
<remarks>
<para>A file attribute view that supports reading or updating a file's Access
Control Lists (ACL) or file owner attributes.</para>
<para>ACLs are used to specify access rights to file system objects. An ACL is
an ordered list of <c>AclEntry access-control-entries</c>, each specifying a
<c>UserPrincipal</c> and the level of access for that user principal. This
file attribute view defines the <c>#getAcl() getAcl</c>, and <c>#setAcl(List) setAcl</c> methods to read and write ACLs based on the ACL
model specified in <see href="http://www.ietf.org/rfc/rfc3530.txt"><i>RFC&nbsp;3530:
Network File System (NFS) version 4 Protocol</i></see>. This file attribute view
is intended for file system implementations that support the NFSv4 ACL model
or have a <em>well-defined</em> mapping between the NFSv4 ACL model and the ACL
model used by the file system. The details of such mapping are implementation
dependent and are therefore unspecified.</para>
<para>This class also extends <c>FileOwnerAttributeView</c> so as to define
methods to get and set the file owner.</para>
<para>When a file system provides access to a set of <c>FileStore
file-systems</c> that are not homogeneous then only some of the file systems may
support ACLs. The <c>FileStore#supportsFileAttributeView
supportsFileAttributeView</c> method can be used to test if a file system
supports ACLs.
<h2>Interoperability</h2>
RFC&nbsp;3530 allows for special user identities to be used on platforms that
support the POSIX defined access permissions. The special user identities
are "<c>OWNER@</c>", "<c>GROUP@</c>", and "<c>EVERYONE@</c>". When both
the <c>AclFileAttributeView</c> and the <c>PosixFileAttributeView</c>
are supported then these special user identities may be included in ACL <c>AclEntry entries</c> that are read or written. The file system's <c>UserPrincipalLookupService</c> may be used to obtain a <c>UserPrincipal</c>
to represent these special identities by invoking the <c>UserPrincipalLookupService#lookupPrincipalByName lookupPrincipalByName</c>
method.</para>
<para><b>Usage Example:</b>
Suppose we wish to add an entry to an existing ACL to grant "joe" access:</para>
<code lang="text/java">// lookup "joe"
UserPrincipal joe = file.getFileSystem().getUserPrincipalLookupService()
.lookupPrincipalByName("joe");
// get view
AclFileAttributeView view = Files.getFileAttributeView(file, AclFileAttributeView.class);
// create ACE to give "joe" read access
AclEntry entry = AclEntry.newBuilder()
.setType(AclEntryType.ALLOW)
.setPrincipal(joe)
.setPermissions(AclEntryPermission.READ_DATA, AclEntryPermission.READ_ATTRIBUTES)
.build();
// read ACL, insert ACE, re-write ACL
List&lt;AclEntry&gt; acl = view.getAcl();
acl.add(0, entry); // insert before any DENY entries
view.setAcl(acl);
</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 follows:
<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"> "acl" </th>
<td> <c>List</c>&lt;<c>AclEntry</c>&gt; </td>
</tr>
<tr>
<th scope="row"> "owner" </th>
<td> <c>UserPrincipal</c></td>
</tr>
</tbody>
</table>
</blockquote></para>
<para>The <c>Files#getAttribute getAttribute</c> method may be used to read
the ACL or owner attributes as if by invoking the <c>#getAcl getAcl</c> or
<c>#getOwner getOwner</c> methods.</para>
<para>The <c>Files#setAttribute setAttribute</c> method may be used to
update the ACL or owner attributes as if by invoking the <c>#setAcl setAcl</c>
or <c>#setOwner setOwner</c> methods.
<h2> Setting the ACL when creating a file </h2></para>
<para>Implementations supporting this attribute view may also support setting
the initial ACL when creating a file or directory. The initial ACL
may be provided to methods such as <c>Files#createFile createFile</c> or <c>Files#createDirectory createDirectory</c> as an <c>FileAttribute</c> with <c>FileAttribute#name name</c><c>"acl:acl"</c> and a <c>FileAttribute#value
value</c> that is the list of <c>AclEntry</c> objects.</para>
<para>Where an implementation supports an ACL model that differs from the NFSv4
defined ACL model then setting the initial ACL when creating the file must
translate the ACL to the model supported by the file system. Methods that
create a file should reject (by throwing <c>IOException IOException</c>)
any attempt to create a file that would be less secure as a result of the
translation.</para>
<para>Added in 1.7.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/AclFileAttributeView" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.AclFileAttributeView</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="Acl">
<MemberSignature Language="C#" Value="public System.Collections.Generic.IList<Java.Nio.FileNio.Attributes.AclEntry>? Acl { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IList`1<class Java.Nio.FileNio.Attributes.AclEntry> Acl" />
<MemberSignature Language="DocId" Value="P:Java.Nio.FileNio.Attributes.IAclFileAttributeView.Acl" />
<MemberSignature Language="F#" Value="member this.Acl : System.Collections.Generic.IList<Java.Nio.FileNio.Attributes.AclEntry> with get, set" Usage="Java.Nio.FileNio.Attributes.IAclFileAttributeView.Acl" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Mono.Android</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[get: Android.Runtime.Register("getAcl", "()Ljava/util/List;", "GetGetAclHandler:Java.Nio.FileNio.Attributes.IAclFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<get: Android.Runtime.Register("getAcl", "()Ljava/util/List;", "GetGetAclHandler:Java.Nio.FileNio.Attributes.IAclFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[get: System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[set: Android.Runtime.Register("setAcl", "(Ljava/util/List;)V", "GetSetAcl_Ljava_util_List_Handler:Java.Nio.FileNio.Attributes.IAclFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]</AttributeName>
<AttributeName Language="F#">[<set: Android.Runtime.Register("setAcl", "(Ljava/util/List;)V", "GetSetAcl_Ljava_util_List_Handler:Java.Nio.FileNio.Attributes.IAclFileAttributeViewInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[set: System.Runtime.Versioning.SupportedOSPlatform("android26.0")]</AttributeName>
<AttributeName Language="F#">[<set: System.Runtime.Versioning.SupportedOSPlatform("android26.0")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Collections.Generic.IList<Java.Nio.FileNio.Attributes.AclEntry></ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>
<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="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.IAclFileAttributeView.Name" />
<MemberSignature Language="F#" Value="abstract member Name : unit -> string" Usage="iAclFileAttributeView.Name " />
<MemberType>Method</MemberType>
<Implements>
<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.IAclFileAttributeViewInvoker, 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.IAclFileAttributeViewInvoker, 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>"acl"</c>.</para>
<para>
<format type="text/html">
<a href="https://developer.android.com/reference/java/nio/file/attribute/AclFileAttributeView#name()" title="Reference documentation">Java documentation for <code>java.nio.file.attribute.AclFileAttributeView.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>
</Members>
</Type>