Table of Contents

Class FileStorageClient

Namespace
Cognite.Simulator.Utils
Assembly
Cognite.Simulator.Utils.dll

HTTP client that can be used to download and upload files from/to a server

public class FileStorageClient
Inheritance
FileStorageClient
Inherited Members

Constructors

FileStorageClient(HttpClient, ILogger<FileStorageClient>)

Initializes this object with the given HTTP client and logger

public FileStorageClient(HttpClient client, ILogger<FileStorageClient> logger)

Parameters

client HttpClient

HTTP client

logger ILogger<FileStorageClient>

logger

Methods

DownloadFileAsync(Uri, string)

Downloads the file from the provided uri and saves it in the provided filePath

public Task<bool> DownloadFileAsync(Uri uri, string filePath)

Parameters

uri Uri
filePath string

Returns

Task<bool>

true if success, else false

UploadFileAsync(Uri, StreamContent)

Uploads a file to the provided uri

public Task UploadFileAsync(Uri uri, StreamContent fileStream)

Parameters

uri Uri
fileStream StreamContent

Returns

Task

Exceptions

HttpRequestException