using System.Collections.Generic; using System.IO; using System.Text; using System.Threading.Tasks; namespace PoweredSoft.Storage.Core { public interface IStorageProvider { Task> GetListAsync(string path); Task> GetDirectories(string path); Task> GetFilesAsync(string path, string pattern = null, SearchOption searchOption = SearchOption.TopDirectoryOnly); Task WriteFileAsync(string sourcePath, string path, bool overrideIfExists = true); Task WriteFileAsync(byte[] bytes, string path, bool overrideIfExists = true); Task WriteFileAsync(Stream stream, string path, bool overrideIfExists = true); Task WriteFileAsync(string sourcePath, string path, IWriteFileOptions options); Task WriteFileAsync(byte[] bytes, string path, IWriteFileOptions options); Task WriteFileAsync(Stream stream, string path, IWriteFileOptions options); Task GetFileStreamAsync(string path); Task GetFileBytesAsync(string path); Task GetFileContentAsync(string path, Encoding encoding); Task FileExistsAsync(string path); Task DeleteFileAsync(string path); Task DeleteDirectoryAsync(string path, bool force = false); Task CreateDirectoryAsync(string path); bool IsFileNameAllowed(string fileName); string SanitizeFileName(string key, string replacement); } }