Table of Contents

Class FilesExtensions

Namespace
Cognite.Simulator.Extensions
Assembly
Cognite.Simulator.Extensions.dll

Class containing extensions to the CDF Files resource with utility methods for simulator integrations

public static class FilesExtensions
Inheritance
FilesExtensions
Inherited Members

Methods

GetExtension(File)

Returns the file extension of a given CDF file. This is based on the file name and returns the extension in lowercase without the leading period.

public static string GetExtension(this File file)

Parameters

file File

Returns

string

GetFileExtension(string)

Returns the file extension of a given file name. This is based on the file name and returns the extension in lowercase without the leading period

public static string GetFileExtension(string fileName)

Parameters

fileName string

Returns

string

RetrieveBatchAsync(FilesResource, IList<long>, int, CancellationToken)

Retrieves file medatadata by their IDs in chunks, ignores unknown IDs. Each batch can contain up to 1000 file IDs and is processed in parallel to others (up to 5 batches at a time).

public static Task<List<File>> RetrieveBatchAsync(this FilesResource cdfFiles, IList<long> internalIds, int chunkSize = 1000, CancellationToken token = default)

Parameters

cdfFiles FilesResource

The FilesResource instance.

internalIds IList<long>

The list of internal IDs of the files to retrieve.

chunkSize int

The maximum number of file IDs to include in each chunk. Default is 1000.

token CancellationToken

The cancellation token.

Returns

Task<List<File>>