Table of Contents

Class FilePathResolver

Namespace
DuetControlServer.Files
Assembly
DuetControlServer.dll

Class used to provide functions for file path resolution

public class FilePathResolver
Inheritance
FilePathResolver
Inherited Members

Constructors

FilePathResolver(ObjectModel, IOptions<Settings>)

Class used to provide functions for file path resolution

public FilePathResolver(ObjectModel model, IOptions<Settings> settings)

Parameters

model ObjectModel
settings IOptions<Settings>

Fields

ConfigFile

Default name of the config file

public const string ConfigFile = "config.g"

Field Value

string

ConfigFileFallback

Fallback file if the config file could not be found

public const string ConfigFileFallback = "config.g.bak"

Field Value

string

ConfigOverrideFile

Config override as generated by M500

public const string ConfigOverrideFile = "config-override.g"

Field Value

string

DsfConfigFile

Extra config file to be run when DCS + all third-party plugins have been started

public const string DsfConfigFile = "dsf-config.g"

Field Value

string

RunOnceFile

File to run once after start if it exists, then deleted again

public const string RunOnceFile = "runonce.g"

Field Value

string

Methods

ToPhysical(string, FileDirectory)

Resolve a RepRapFirmware/FatFs-style file path to a physical file path. The first drive (0:/) is reserved for usage with the base directory as specified in the settings

public string ToPhysical(string filePath, FileDirectory directory)

Parameters

filePath string

File path to resolve

directory FileDirectory

Directory containing filePath if it is not absolute is specified

Returns

string

Resolved file path

ToPhysical(string, string?)

Resolve a RepRapFirmware/FatFs-style file path to a physical file path. The first drive (0:/) is reserved for usage with the base directory as specified in the settings.

public string ToPhysical(string filePath, string? directory = null)

Parameters

filePath string

File path to resolve

directory string

Directory containing filePath if it is not absolute is specified

Returns

string

Resolved file path

ToPhysicalAsync(string, FileDirectory, CancellationToken)

Resolve a RepRapFirmware/FatFs-style file path to a physical file path asynchronously. The first drive (0:/) is reserved for usage with the base directory as specified in the settings

public Task<string> ToPhysicalAsync(string filePath, FileDirectory directory, CancellationToken cancellationToken = default)

Parameters

filePath string

File path to resolve

directory FileDirectory

Directory containing filePath if it is not absolute is specified

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<string>

Resolved file path

ToPhysicalAsync(string, string?, CancellationToken)

Resolve a RepRapFirmware/FatFs-style file path to a physical file path asynchronously. The first drive (0:/) is reserved for usage with the base directory as specified in the settings.

public Task<string> ToPhysicalAsync(string filePath, string? directory = null, CancellationToken cancellationToken = default)

Parameters

filePath string

File path to resolve

directory string

Directory containing filePath if it is not absolute is specified

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<string>

Resolved file path

ToVirtual(string)

Convert a physical ile path to a RRF-style file path. The first drive (0:/) is reserved for usage with the base directory as specified in the settings.

public string ToVirtual(string filePath)

Parameters

filePath string

File path to convert

Returns

string

Resolved file path

ToVirtualAsync(string, CancellationToken)

Convert a physical ile path to a RRF-style file path asynchronously. The first drive (0:/) is reserved for usage with the base directory as specified in the settings.

public Task<string> ToVirtualAsync(string filePath, CancellationToken cancellationToken = default)

Parameters

filePath string

File path to convert

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<string>

Resolved file path