IDefaultResourcePathProvider Interface
Provides an ordered sequence of file-system directories where the application searches for resources such as configuration files, templates, and license files.
public interface IDefaultResourcePathProviderRemarks
Section titled “Remarks”Implementations are platform-aware. On Windows the default paths include the executing
and entry assembly directories plus the HAKOM folders under %ProgramW6432% and
%ProgramFiles(x86)%. On Linux the paths /etc/hakom and
/usr/share/hakom are used instead.
Instances can be obtained through the DI container via UseStandardDefaultResourcePaths(this IContainer) or UseDefaultResourcePaths(this IContainer, string[]), or created directly with the static factory methods FromLocations(string[]) and Default.
Properties
Section titled “Properties”IDefaultResourcePathProvider.Default Property
Section titled “IDefaultResourcePathProvider.Default Property”Gets a singleton IDefaultResourcePathProvider that uses the platform-specific default resource search locations.
static HAKOM.Persistence.FileSystem.Net.Api.IDefaultResourcePathProvider Default { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”IDefaultResourcePathProvider.FromLocations(string[]) Method
Section titled “IDefaultResourcePathProvider.FromLocations(string[]) Method”Creates an IDefaultResourcePathProvider that yields the specified paths in order.
static HAKOM.Persistence.FileSystem.Net.Api.IDefaultResourcePathProvider FromLocations(string[] paths);Parameters
Section titled “Parameters”paths System.String[]
An array of directory paths to return from GetPaths(CancellationToken). Must not be null.
Returns
Section titled “Returns”IDefaultResourcePathProvider
A new provider backed by the supplied paths.
Exceptions
Section titled “Exceptions”System.ArgumentNullException
paths is null.
IDefaultResourcePathProvider.GetPaths(CancellationToken) Method
Section titled “IDefaultResourcePathProvider.GetPaths(CancellationToken) Method”Asynchronously enumerates the resource search directories provided by this instance.
System.Collections.Generic.IAsyncEnumerable<string> GetPaths(System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
Section titled “Parameters”cancellationToken System.Threading.CancellationToken
A token that can be used to cancel the enumeration.
Returns
Section titled “Returns”System.Collections.Generic.IAsyncEnumerable<System.String>
An System.Collections.Generic.IAsyncEnumerable<> of directory path strings in priority order.