public static void SetAccessControl(this FileInfo fileInfo, FileSecurity fileSecurity) { if (fileSecurity == null) throw new ArgumentNullException(nameof(fileSecurity)); Contract.EndContractBlock(); String fullPath = Path.GetFullPath(fileInfo.FullName); // Appropriate security check should be done for us by FileSecurity. fileSecurity.Persist(fullPath); }
[System.Security.SecuritySafeCritical] // auto-generated public static void SetAccessControl(this FileStream fileStream, FileSecurity fileSecurity) { SafeFileHandle handle = fileStream.SafeFileHandle; if (fileSecurity == null) throw new ArgumentNullException(nameof(fileSecurity)); Contract.EndContractBlock(); if (handle.IsClosed) { throw new ObjectDisposedException(null, SR.ObjectDisposed_FileClosed); } fileSecurity.Persist(handle, fileStream.Name); }
[System.Security.SecuritySafeCritical] // auto-generated public static void SetAccessControl(String path, FileSecurity fileSecurity) { if (fileSecurity == null) throw new ArgumentNullException("fileSecurity"); Contract.EndContractBlock(); String fullPath = Path.GetFullPathInternal(path); // Appropriate security check should be done for us by FileSecurity. fileSecurity.Persist(fullPath); }
public void SetAccessControl(FileSecurity fileSecurity) { if (fileSecurity == null) { throw new ArgumentNullException("fileSecurity"); } if (this._handle.IsClosed) { __Error.FileNotOpen(); } fileSecurity.Persist(this._handle, this._fileName); }
public static void SetAccessControl(string path, FileSecurity fileSecurity) { if (fileSecurity == null) { throw new ArgumentNullException("fileSecurity"); } string fullPathInternal = Path.GetFullPathInternal(path); fileSecurity.Persist(fullPathInternal); }