Exemple #1
0
        public LocalDirectory(LocalFileSystem fs, string path, OpenDirectoryMode mode)
        {
            ParentFileSystem = fs;
            FullPath         = path;
            LocalPath        = fs.ResolveLocalPath(path);
            Mode             = mode;

            try
            {
                DirInfo = new DirectoryInfo(LocalPath);
            }
            catch (Exception ex) when(ex is ArgumentNullException || ex is ArgumentException ||
                                      ex is PathTooLongException)
            {
                ThrowHelper.ThrowResult(ResultFs.PathNotFound, ex);
                throw;
            }

            if (!DirInfo.Exists)
            {
                ThrowHelper.ThrowResult(ResultFs.PathNotFound);
            }
        }
        public static void Extract(this IFileSystem source, string destinationPath, IProgressReport logger = null)
        {
            var destFs = new LocalFileSystem(destinationPath);

            source.CopyFileSystem(destFs, logger);
        }