Class BlobEndpointExtensions
Provides extension methods for IBlobEndpoint.
public static class BlobEndpointExtensions
- Inheritance
-
BlobEndpointExtensions
- Inherited Members
Methods
DownloadAsync(IBlobEndpoint, string, CancellationToken)
Downloads the blob's content to a file.
public static Task DownloadAsync(this IBlobEndpoint endpoint, string path, CancellationToken cancellationToken = default)
Parameters
endpointIBlobEndpointThe blob endpoint.
pathstringThe path of the file to write the download data to.
cancellationTokenCancellationTokenUsed to cancel the request.
Returns
- Task
A stream with the blob's content.
Exceptions
- IOException
Failed to write the file.
- AuthenticationException
- UnauthorizedAccessException
- KeyNotFoundException
- HttpRequestException
Other non-success status code.
UploadFromAsync(IBlobEndpoint, string, string?, CancellationToken)
Uploads content as the blob's content from a file.
public static Task UploadFromAsync(this IBlobEndpoint endpoint, string path, string? mimeType = null, CancellationToken cancellationToken = default)
Parameters
endpointIBlobEndpointThe blob endpoint.
pathstringThe path of the file to read the upload data from.
mimeTypestringThe MIME type of the data to upload.
cancellationTokenCancellationTokenUsed to cancel the request.
Returns
Exceptions
- IOException
Failed to read the file.
- InvalidDataException
- AuthenticationException
- UnauthorizedAccessException
- KeyNotFoundException
- HttpRequestException
Other non-success status code.