Show / Hide Table of Contents

Interface IBlobContainer

Namespace: Volo.Abp.BlobStoring
Assembly: Volo.Abp.BlobStoring.dll
Syntax
public interface IBlobContainer

Methods

DeleteAsync(String, CancellationToken)

Deletes a blob from the container.

Declaration
Task<bool> DeleteAsync(string name, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String name

The name of the blob

CancellationToken cancellationToken

Cancellation token

Returns
Type Description
Task<System.Boolean>

Returns true if actually deleted the blob. Returns false if the blob with the given name was not exists.

ExistsAsync(String, CancellationToken)

Checks if a blob does exists in the container.

Declaration
Task<bool> ExistsAsync(string name, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String name

The name of the blob

CancellationToken cancellationToken

Cancellation token

Returns
Type Description
Task<System.Boolean>

GetAsync(String, CancellationToken)

Gets a blob from the container. It actually gets a to read the blob data. It throws exception if there is no blob with the given name. Use GetOrNullAsync(String, CancellationToken) if you want to get

null
if there is no blob with the given name.

Declaration
Task<Stream> GetAsync(string name, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String name

The name of the blob

CancellationToken cancellationToken

Cancellation token

Returns
Type Description
Task<Stream>

A to read the blob data.

GetOrNullAsync(String, CancellationToken)

Gets a blob from the container, or returns null if there is no blob with the given name. It actually gets a to read the blob data.

Declaration
Task<Stream> GetOrNullAsync(string name, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String name

The name of the blob

CancellationToken cancellationToken

Cancellation token

Returns
Type Description
Task<Stream>

A to read the blob data.

SaveAsync(String, Stream, Boolean, CancellationToken)

Saves a blob to the container.

Declaration
Task SaveAsync(string name, Stream stream, bool overrideExisting = false, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String name

The name of the blob

Stream stream

A stream for the blob

System.Boolean overrideExisting

Set

true
to override if there is already a blob in the container with the given name. If set to
false
(default), throws exception if there is already a blob in the container with the given name.

CancellationToken cancellationToken

Cancellation token

Returns
Type Description
Task

Extension Methods

AbpObjectExtensions.As<T>(Object)
AbpObjectExtensions.To<T>(Object)
AbpObjectExtensions.IsIn<T>(T, T[])
AbpObjectExtensions.If<T>(T, Boolean, Func<T, T>)
AbpObjectExtensions.If<T>(T, Boolean, Action<T>)
LockExtensions.Locking(Object, Action)
LockExtensions.Locking<T>(T, Action<T>)
LockExtensions.Locking<TResult>(Object, Func<TResult>)
LockExtensions.Locking<T, TResult>(T, Func<T, TResult>)
BlobContainerExtensions.SaveAsync(IBlobContainer, String, Byte[], Boolean, CancellationToken)
BlobContainerExtensions.GetAllBytesAsync(IBlobContainer, String, CancellationToken)
BlobContainerExtensions.GetAllBytesOrNullAsync(IBlobContainer, String, CancellationToken)
Back to top Powered by Volosoft