ScrewTurn.Wiki.FilesAndAttachments.ListFiles C# (CSharp) Method

ListFiles() public static method

Lists the files in a directory.
If the specified directory is the root, then the list is performed on all providers.
public static ListFiles ( string fullPath ) : string[]
fullPath string The full path.
return string[]
        public static string[] ListFiles(string fullPath)
        {
            fullPath = NormalizeFullPath(fullPath);

            if(fullPath == "/") {
                List<string> files = new List<string>(50);

                foreach(IFilesStorageProviderV30 provider in Collectors.FilesProviderCollector.AllProviders) {
                    files.AddRange(provider.ListFiles(fullPath));
                }

                files.Sort();

                return files.ToArray();
            }
            else {
                IFilesStorageProviderV30 provider = FindDirectoryProvider(fullPath);
                return provider.ListFiles(fullPath);
            }
        }