@ -3,6 +3,7 @@ using Minio.Exceptions;
using System ;
using System.IO ;
using System.Threading.Tasks ;
using Minio.DataModel.Args ;
using Volo.Abp.DependencyInjection ;
namespace Volo.Abp.BlobStoring.Minio ;
@ -20,7 +21,7 @@ public class MinioBlobProvider : BlobProviderBase, ITransientDependency
BlobNormalizeNamingService = blobNormalizeNamingService ;
}
public override async Task SaveAsync ( BlobProviderSaveArgs args )
public async override Task SaveAsync ( BlobProviderSaveArgs args )
{
var blobName = MinioBlobNameCalculator . Calculate ( args ) ;
var configuration = args . Configuration . GetMinioConfiguration ( ) ;
@ -44,7 +45,7 @@ public class MinioBlobProvider : BlobProviderBase, ITransientDependency
. WithObjectSize ( args . BlobStream . Length ) ) ;
}
public override async Task < bool > DeleteAsync ( BlobProviderDeleteArgs args )
public async override Task < bool > DeleteAsync ( BlobProviderDeleteArgs args )
{
var blobName = MinioBlobNameCalculator . Calculate ( args ) ;
var client = GetMinioClient ( args ) ;
@ -60,7 +61,7 @@ public class MinioBlobProvider : BlobProviderBase, ITransientDependency
}
public override async Task < bool > ExistsAsync ( BlobProviderExistsArgs args )
public async override Task < bool > ExistsAsync ( BlobProviderExistsArgs args )
{
var blobName = MinioBlobNameCalculator . Calculate ( args ) ;
var client = GetMinioClient ( args ) ;
@ -69,7 +70,7 @@ public class MinioBlobProvider : BlobProviderBase, ITransientDependency
return await BlobExistsAsync ( client , containerName , blobName ) ;
}
public override async Task < Stream ? > GetOrNullAsync ( BlobProviderGetArgs args )
public async override Task < Stream ? > GetOrNullAsync ( BlobProviderGetArgs args )
{
var blobName = MinioBlobNameCalculator . Calculate ( args ) ;
var client = GetMinioClient ( args ) ;
@ -97,7 +98,7 @@ public class MinioBlobProvider : BlobProviderBase, ITransientDependency
return memoryStream ;
}
protected virtual MinioClient GetMinioClient ( BlobProviderArgs args )
protected virtual I MinioClient GetMinioClient ( BlobProviderArgs args )
{
var configuration = args . Configuration . GetMinioConfiguration ( ) ;
@ -113,7 +114,7 @@ public class MinioBlobProvider : BlobProviderBase, ITransientDependency
return client . Build ( ) ;
}
protected virtual async Task CreateBucketIfNotExists ( MinioClient client , string containerName )
protected virtual async Task CreateBucketIfNotExists ( I MinioClient client , string containerName )
{
if ( ! await client . BucketExistsAsync ( new BucketExistsArgs ( ) . WithBucket ( containerName ) ) )
{
@ -121,7 +122,7 @@ public class MinioBlobProvider : BlobProviderBase, ITransientDependency
}
}
protected virtual async Task < bool > BlobExistsAsync ( MinioClient client , string containerName , string blobName )
protected virtual async Task < bool > BlobExistsAsync ( I MinioClient client , string containerName , string blobName )
{
// Make sure Blob Container exists.
if ( await client . BucketExistsAsync ( new BucketExistsArgs ( ) . WithBucket ( containerName ) ) )