public static IFileSystemInfo GetFileSystemInfo([NotNull] string path) { var file = new FileInfo(path); if (file.Exists) { return(AdapterHelper.Adapt(file)); } var directory = new DirectoryInfo(path); if (directory.Exists) { return(AdapterHelper.Adapt(directory)); } return(new FileSystemInfoAdapter(file)); }
public virtual IDirectorySecurity GetAccessControl(AccessControlSections includeSections) { return(AdapterHelper.Adapt(_directoryInfo.GetAccessControl(includeSections))); }
public virtual IDirectorySecurity GetAccessControl() { return(AdapterHelper.Adapt(_directoryInfo.GetAccessControl())); }
public virtual IFile CopyTo(string destFileName, bool overwrite) { // ReSharper disable once AssignNullToNotNullAttribute return(AdapterHelper.Adapt(_fileInfo.CopyTo(destFileName, overwrite))); }
public virtual IFileSecurity GetAccessControl(AccessControlSections includeSections) { return(AdapterHelper.Adapt(_fileInfo.GetAccessControl(includeSections))); }
public virtual IFileSecurity GetAccessControl() { return(AdapterHelper.Adapt(_fileInfo.GetAccessControl())); }
public virtual IFile Replace(string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors) { // ReSharper disable once AssignNullToNotNullAttribute return(AdapterHelper.Adapt(_fileInfo.Replace(destinationFileName, destinationBackupFileName, ignoreMetadataErrors))); }
public static IFile GetFile([NotNull] string path) { return(AdapterHelper.Adapt(new FileInfo(path))); }
public static IDirectory GetDirectory([NotNull] string path) { return(AdapterHelper.Adapt(new DirectoryInfo(path))); }