Exemple #1
0
        public IEnumerable <FileSystemMetadata> GetFileSystemEntries(string path, bool recursive = false)
        {
            if (_sharpCifsFileSystem.IsEnabledForPath(path))
            {
                return(_sharpCifsFileSystem.GetFileSystemEntries(path, recursive));
            }

            var directoryInfo = new DirectoryInfo(path);
            var searchOption  = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly;

            if (EnableFileSystemRequestConcat)
            {
                return(ToMetadata(directoryInfo.EnumerateDirectories("*", searchOption))
                       .Concat(ToMetadata(directoryInfo.EnumerateFiles("*", searchOption))));
            }

            return(ToMetadata(directoryInfo.EnumerateFileSystemInfos("*", searchOption)));
        }