Skip to main content

ResQ.Storage.IStorageClient

IStorageClient.GetAsync(string, CancellationToken) Method

Retrieves file content by its IPFS CID.

Parameters

cid System.String The IPFS Content Identifier of the file to retrieve. cancellationToken System.Threading.CancellationToken Cancellation token for the operation.

Returns

System.Threading.Tasks.Task<System.IO.Stream>
A stream containing the file content.

Exceptions

System.ArgumentNullException
Thrown when cid is null or empty.
System.InvalidOperationException
Thrown when the file cannot be retrieved.
System.OperationCanceledException
Thrown when the operation is cancelled.

Example

Remarks

The content is retrieved through the configured IPFS gateway. The caller is responsible for disposing the returned stream. In mock mode, returns a mock stream.