using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using API.DTOs;
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 = "");
///
/// Returns true if the path exists and is a directory. If path does not exist, this will create it. Returns false in all fail cases.
///
///
///
bool ExistOrCreate(string directoryPath);
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);
IEnumerable GetFiles(string path, string searchPatternExpression = "",
SearchOption searchOption = SearchOption.TopDirectoryOnly);
}
}