Udostępnij za pośrednictwem


PosixFilePermissions.AsFileAttribute Method

Definition

Creates a FileAttribute, encapsulating a copy of the given file permissions, suitable for passing to the java.nio.file.Files#createFile createFile or java.nio.file.Files#createDirectory createDirectory methods.

[Android.Runtime.Register("asFileAttribute", "(Ljava/util/Set;)Ljava/nio/file/attribute/FileAttribute;", "", ApiSince=26)]
public static Java.Nio.FileNio.Attributes.IFileAttribute? AsFileAttribute (System.Collections.Generic.ICollection<Java.Nio.FileNio.Attributes.PosixFilePermission>? perms);
[<Android.Runtime.Register("asFileAttribute", "(Ljava/util/Set;)Ljava/nio/file/attribute/FileAttribute;", "", ApiSince=26)>]
static member AsFileAttribute : System.Collections.Generic.ICollection<Java.Nio.FileNio.Attributes.PosixFilePermission> -> Java.Nio.FileNio.Attributes.IFileAttribute

Parameters

perms
ICollection<PosixFilePermission>

the set of permissions

Returns

an attribute encapsulating the given file permissions with FileAttribute#name name"posix:permissions"

Attributes

Remarks

Creates a FileAttribute, encapsulating a copy of the given file permissions, suitable for passing to the java.nio.file.Files#createFile createFile or java.nio.file.Files#createDirectory createDirectory methods.

Java documentation for java.nio.file.attribute.PosixFilePermissions.asFileAttribute(java.util.Set<java.nio.file.attribute.PosixFilePermission>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to