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
modelObjectModelsettingsIOptions<Settings>
Fields
ConfigFile
Default name of the config file
public const string ConfigFile = "config.g"
Field Value
ConfigFileFallback
Fallback file if the config file could not be found
public const string ConfigFileFallback = "config.g.bak"
Field Value
ConfigOverrideFile
Config override as generated by M500
public const string ConfigOverrideFile = "config-override.g"
Field Value
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
RunOnceFile
File to run once after start if it exists, then deleted again
public const string RunOnceFile = "runonce.g"
Field Value
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
filePathstringFile path to resolve
directoryFileDirectoryDirectory 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
filePathstringFile path to resolve
directorystringDirectory 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
filePathstringFile path to resolve
directoryFileDirectoryDirectory containing filePath if it is not absolute is specified
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
filePathstringFile path to resolve
directorystringDirectory containing filePath if it is not absolute is specified
cancellationTokenCancellationTokenOptional cancellation token
Returns
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
filePathstringFile 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
filePathstringFile path to convert
cancellationTokenCancellationTokenOptional cancellation token