ParallelModelBlobClient.DownloadToFileAsync method
Downloads a blob to a local file and returns the resolved destination path.
public Task<string> DownloadToFileAsync(Guid modelId, Guid blobId, string encryptionKey,
string destinationPath, TimeSpan? timeout = default,
CancellationToken cancellationToken = default)
| parameter | description |
|---|---|
| modelId | The non-empty identifier of the model. |
| blobId | The non-empty identifier of the blob. |
| encryptionKey | The encryption key supplied with the blob request. |
| destinationPath | The local destination file path. Its parent directory must already exist. |
| timeout | The optional timeout for the operation. |
| cancellationToken | The token used to cancel the operation. |
Return Value
A task containing the absolute path to the downloaded file.
Exceptions
| exception | condition |
|---|---|
| ParallelModelConfigurationException | An identifier is empty or the destination path is invalid. |
| ParallelModelFileTransferException | The destination directory does not exist or a file system error prevents writing the blob. |
Remarks
The content is first written to a temporary file in the destination directory. An existing destination file is overwritten after the download succeeds.
See Also
- class ParallelModelBlobClient
- namespace ParallelModel.Sdk.Shared.Blob