Skip to content

Commit

Permalink
Add a default NullLocalFileDownloadProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
gdlcf88 committed Oct 14, 2023
1 parent c10d396 commit b11d0d4
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.IO;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;

namespace EasyAbp.FileManagement.Files;

[Dependency(TryRegister = true)]
public class NullLocalFileDownloadProvider : ILocalFileDownloadProvider, ISingletonDependency
{
public Task<FileDownloadInfoModel> CreateDownloadInfoAsync(File file)
{
return Task.FromResult(new FileDownloadInfoModel());
}

public Task CheckTokenAsync(string token, Guid fileId)
{
return Task.CompletedTask;
}

public Task<byte[]> GetDownloadBytesAsync(File file)
{
return Task.FromResult<byte[]>(null);
}

public Task<Stream> GetDownloadStreamAsync(File file)
{
return Task.FromResult<Stream>(null);
}
}

0 comments on commit b11d0d4

Please sign in to comment.