Class FileSystemAssetSource
An asset source backed by a local file system directory.
public sealed class FileSystemAssetSource : IAssetSource, IDisposable, IAsyncDisposable
- Inheritance
-
FileSystemAssetSource
- Implements
- Inherited Members
Properties
RootPath
The full path of the root directory relative paths resolve against.
public string RootPath { get; }
Property Value
Methods
Create(string)
Creates a FileSystemAssetSource rooted at the given directory.
public static FileSystemAssetSource Create(string directoryPath)
Parameters
directoryPathstringThe path to the root directory.
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
OpenAsync(string, CancellationToken)
Opens a readable stream for the asset at the given relative path within the source.
public Task<Stream> OpenAsync(string relativePath, CancellationToken cancellationToken = default)
Parameters
relativePathstringA forward-slash separated relative path to the asset.
cancellationTokenCancellationTokenA cancellation token.