Language

Files.SetOwner(IPath, IUserPrincipal) メソッド

定義

ファイル所有者を更新します。

[Android.Runtime.Register("setOwner", "(Ljava/nio/file/Path;Ljava/nio/file/attribute/UserPrincipal;)Ljava/nio/file/Path;", "", ApiSince=26)]
public static Java.Nio.FileNio.IPath? SetOwner(Java.Nio.FileNio.IPath? path, Java.Nio.FileNio.Attributes.IUserPrincipal? owner);
[<Android.Runtime.Register("setOwner", "(Ljava/nio/file/Path;Ljava/nio/file/attribute/UserPrincipal;)Ljava/nio/file/Path;", "", ApiSince=26)>]
static member SetOwner : Java.Nio.FileNio.IPath * Java.Nio.FileNio.Attributes.IUserPrincipal -> Java.Nio.FileNio.IPath

パラメーター

path
IPath

ファイルへのパス

owner
IUserPrincipal

新しいファイル所有者

返品

指定されたパス

属性

注釈

ファイル所有者を更新します。

path パラメーターは、FileOwnerAttributeViewをサポートするファイル システムに関連付けられています。 このファイル属性ビューは、ファイルの所有者であるファイル属性へのアクセスを提供します。

<b>Usage の例:</b> "joe" をファイルの所有者にしたいとします。

Path path = ...
                UserPrincipalLookupService lookupService =
                    provider(path).getUserPrincipalLookupService();
                UserPrincipal joe = lookupService.lookupPrincipalByName("joe");
                Files.setOwner(path, joe);

Javaドキュメント。

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象