using dy.net.model.dto; namespace dy.net.storage { public interface IMediaStorage { StorageType StorageType { get; } Task EnsureDirectoryAsync(string path, CancellationToken cancellationToken = default); Task ExistsAsync(string path, CancellationToken cancellationToken = default); Task GetLengthAsync(string path, CancellationToken cancellationToken = default); Task WriteAsync(string path, Stream source, long? contentLength = null, string contentType = null, CancellationToken cancellationToken = default); Task OpenReadAsync(string path, long? from = null, long? to = null, CancellationToken cancellationToken = default); Task DeleteAsync(string path, CancellationToken cancellationToken = default); } /// /// Optional capability for providers that expose a canonical path spelling different from /// the logical path requested by the application. /// public interface ICanonicalMediaStorage { Task CanonicalizePathAsync( string path, bool createParentDirectories = false, CancellationToken cancellationToken = default); } }