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 |
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 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 |
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
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 |
SaveAsync(String, Stream, Boolean, CancellationToken)
Saves a blob
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 to override if there is already a blob in the container with the given name.
If set to (default), throws exception if there is already a blob in the container with the given name.
|
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task |