Beispiel #1
0
        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));
        }
Beispiel #2
0
 public virtual IDirectorySecurity GetAccessControl(AccessControlSections includeSections)
 {
     return(AdapterHelper.Adapt(_directoryInfo.GetAccessControl(includeSections)));
 }
Beispiel #3
0
 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)));
 }
Beispiel #8
0
 public static IFile GetFile([NotNull] string path)
 {
     return(AdapterHelper.Adapt(new FileInfo(path)));
 }
Beispiel #9
0
 public static IDirectory GetDirectory([NotNull] string path)
 {
     return(AdapterHelper.Adapt(new DirectoryInfo(path)));
 }