Table of Contents

Class NullStorageService

Namespace
FoundationaLLM.Common.Services.Storage
Assembly
FoundationaLLM.Common.dll

No-op implementation of the storage service.

public class NullStorageService : IStorageService
Inheritance
NullStorageService
Implements
Inherited Members
Extension Methods

Remarks

This implementation should be used by resource providers that are using a different storage mechanism than blob storage.

Properties

InstanceName

The optional instance name of the storage service.

public string? InstanceName { get; set; }

Property Value

string

StorageAccountName

The name of the storage account.

public string? StorageAccountName { get; }

Property Value

string

StorageContainerName

The name of the storage container.

public string? StorageContainerName { get; }

Property Value

string

Methods

DeleteFileAsync(string, string, CancellationToken)

Deletes a file from storage.

public Task DeleteFileAsync(string containerName, string filePath, CancellationToken cancellationToken = default)

Parameters

containerName string

The name of the container where the file is located.

filePath string

The path of the file to delete.

cancellationToken CancellationToken

The cancellation token that signals that operations should be cancelled.

Returns

Task

FileExistsAsync(string, string, CancellationToken)

Checks if a file exists on the storage.

public Task<bool> FileExistsAsync(string containerName, string filePath, CancellationToken cancellationToken)

Parameters

containerName string

The name of the container where the file is located.

filePath string

The path of the file to read.

cancellationToken CancellationToken

The cancellation token that signals that operations should be cancelled.

Returns

Task<bool>

GetFilePathsAsync(string, string?, bool, CancellationToken)

Retrieves a list file paths in the specific directory.

public Task<List<string>> GetFilePathsAsync(string containerName, string? directoryPath = null, bool recursive = true, CancellationToken cancellationToken = default)

Parameters

containerName string

Name of the container, file system or Workspace name.

directoryPath string

Directory to list file contents

recursive bool

Recurse through child folders

cancellationToken CancellationToken

Determines if a request should be cancelled.

Returns

Task<List<string>>

List of individual file paths located in the container.

ReadFileAsync(string, string, CancellationToken)

Reads the binary content of a specified file from the storage.

public Task<BinaryData> ReadFileAsync(string containerName, string filePath, CancellationToken cancellationToken)

Parameters

containerName string

The name of the container where the file is located.

filePath string

The path of the file to read.

cancellationToken CancellationToken

The cancellation token that signals that operations should be cancelled.

Returns

Task<BinaryData>

The binary content of the file.

WriteFileAsync(string, string, Stream, string?, CancellationToken)

Writes the binary content to a specified file from the storage.

public Task WriteFileAsync(string containerName, string filePath, Stream fileContent, string? contentType, CancellationToken cancellationToken)

Parameters

containerName string

The name of the container where the file is located.

filePath string

The path of the file to read.

fileContent Stream

The binary content written to the file.

contentType string

An optional content type.

cancellationToken CancellationToken

The cancellation token that signals that operations should be cancelled.

Returns

Task

WriteFileAsync(string, string, string, string?, CancellationToken)

Writes the string content to a specified file from the storage.

public Task WriteFileAsync(string containerName, string filePath, string fileContent, string? contentType, CancellationToken cancellationToken)

Parameters

containerName string

The name of the container where the file is located.

filePath string

The path of the file to read.

fileContent string

The string content written to the file.

contentType string

An optional content type.

cancellationToken CancellationToken

The cancellation token that signals that operations should be cancelled.

Returns

Task