using System.Collections.Generic; using System.IO; using System.Threading.Tasks; namespace API.Interfaces.Services { public interface IDirectoryService { /// /// Lists out top-level folders for a given directory. Filters out System and Hidden folders. /// /// Absolute path of directory to scan. /// List of folder names IEnumerable ListDirectory(string rootPath); /// /// Gets files in a directory. If searchPatternExpression is passed, will match the regex against for filtering. /// /// /// /// string[] GetFilesWithExtension(string path, string searchPatternExpression = ""); Task ReadFileAsync(string path); /// /// Deletes all files within the directory, then the directory itself. /// /// //void ClearAndDeleteDirectory(string directoryPath); /// /// Deletes all files within the directory. /// /// /// //void ClearDirectory(string directoryPath); bool CopyFilesToDirectory(IEnumerable filePaths, string directoryPath); bool Exists(string directory); IEnumerable GetFiles(string path, string searchPatternExpression = "", SearchOption searchOption = SearchOption.TopDirectoryOnly); } }