diff --git a/src/OrchardCore/OrchardCore.Media.Core/DefaultMediaFileStore.cs b/src/OrchardCore/OrchardCore.Media.Core/DefaultMediaFileStore.cs index 012fba79d2e..5b06b9998ee 100644 --- a/src/OrchardCore/OrchardCore.Media.Core/DefaultMediaFileStore.cs +++ b/src/OrchardCore/OrchardCore.Media.Core/DefaultMediaFileStore.cs @@ -40,27 +40,27 @@ ILogger logger _logger = logger; } - public Task GetFileInfoAsync(string path) + public virtual Task GetFileInfoAsync(string path) { return _fileStore.GetFileInfoAsync(path); } - public Task GetDirectoryInfoAsync(string path) + public virtual Task GetDirectoryInfoAsync(string path) { return _fileStore.GetDirectoryInfoAsync(path); } - public Task> GetDirectoryContentAsync(string path = null, bool includeSubDirectories = false) + public virtual Task> GetDirectoryContentAsync(string path = null, bool includeSubDirectories = false) { return _fileStore.GetDirectoryContentAsync(path, includeSubDirectories); } - public Task TryCreateDirectoryAsync(string path) + public virtual Task TryCreateDirectoryAsync(string path) { return _fileStore.TryCreateDirectoryAsync(path); } - public async Task TryDeleteFileAsync(string path) + public virtual async Task TryDeleteFileAsync(string path) { var deletingContext = new MediaDeletingContext { @@ -82,7 +82,7 @@ public async Task TryDeleteFileAsync(string path) return result; } - public async Task TryDeleteDirectoryAsync(string path) + public virtual async Task TryDeleteDirectoryAsync(string path) { var deletingContext = new MediaDeletingContext { @@ -104,7 +104,7 @@ public async Task TryDeleteDirectoryAsync(string path) return result; } - public async Task MoveFileAsync(string oldPath, string newPath) + public virtual async Task MoveFileAsync(string oldPath, string newPath) { var context = new MediaMoveContext { @@ -119,22 +119,22 @@ public async Task MoveFileAsync(string oldPath, string newPath) await _mediaEventHandlers.InvokeAsync((handler, context) => handler.MediaMovedAsync(context), context, _logger); } - public Task CopyFileAsync(string srcPath, string dstPath) + public virtual Task CopyFileAsync(string srcPath, string dstPath) { return _fileStore.CopyFileAsync(srcPath, dstPath); } - public Task GetFileStreamAsync(string path) + public virtual Task GetFileStreamAsync(string path) { return _fileStore.GetFileStreamAsync(path); } - public Task GetFileStreamAsync(IFileStoreEntry fileStoreEntry) + public virtual Task GetFileStreamAsync(IFileStoreEntry fileStoreEntry) { return _fileStore.GetFileStreamAsync(fileStoreEntry); } - public async Task CreateFileFromStreamAsync(string path, Stream inputStream, bool overwrite = false) + public virtual async Task CreateFileFromStreamAsync(string path, Stream inputStream, bool overwrite = false) { if (_mediaCreatingEventHandlers.Any()) { @@ -176,7 +176,7 @@ public async Task CreateFileFromStreamAsync(string path, Stream inputStr } } - public string MapPathToPublicUrl(string path) + public virtual string MapPathToPublicUrl(string path) { return _cdnBaseUrl + _requestBasePath + "/" + _fileStore.NormalizePath(path); }