IReadOnlyFileSystem Interface
Represents a file system.
Namespace
Statiq.Common
Implementing Types
graph BT Type["IReadOnlyFileSystem"] class Type type-node Implementing0["TestFileSystem"]-.->Type click Implementing0 "/api/Statiq.Testing/TestFileSystem" Implementing1["IFileSystem"]-.->Type click Implementing1 "/api/Statiq.Common/IFileSystem" Implementing2["FileSystem"]-.->Type click Implementing2 "/api/Statiq.Core/FileSystem"

Syntax

public interface IReadOnlyFileSystem

Properties

Name Property Type Summary
CachePath NormalizedPath
Gets the cache file path.
ExcludedPaths IReadOnlyList<NormalizedPath>
Gets the excluded paths collection which can be used to excluded specific paths from the input paths. Any IDirectory or IFile within an excluded path will appear to be non-existing.
FileProvider IFileProvider
Gets the file provider.
InputPathMappings IReadOnlyDictionary<NormalizedPath, NormalizedPath>
Maps input paths to their location in the virtual file system. The key should be a NormalizedPath that exists in InputPaths. The value should be a relative path where the input path should be mapped within the virtual folder heirarchy.
InputPaths IReadOnlyList<NormalizedPath>
Gets the input paths. These are searched in reverse order for files and directories. For example, given input paths "A", "B", and "C" in that order, "C" will be checked for a requested file or directory first, and then if it doesn't exist in "C", "B" will be checked, and then "A". If none of the input paths contain the requested file or directory, the last input path (in this case, "C") will be used as the location of the requested non-existent file or directory. If you attempt to create it at this point, it will be created under path "C".
OutputPath NormalizedPath
Gets the output path.
RootPath NormalizedPath
Gets the root path.
TempPath NormalizedPath
Gets the temporary file path.
WriteTracker IFileWriteTracker
Tracks the state of files being written to and their source content. This helps determine when a file should be overwritten when using Unwritten.

Extension Methods

Name Value Summary
GetCacheDirectory(NormalizedPath) IDirectory
Gets a directory representing cache files.
GetCacheDirectory() IDirectory
Gets a directory representing cache files.
GetCacheFile(NormalizedPath) IFile
Gets a file representing a cache file.
GetCacheFile() IFile
Gets a file representing a cache file with a random file name.
GetCachePath(NormalizedPath) NormalizedPath
Gets a cache path by combining it with the root path and cache path.
GetCachePath() NormalizedPath
Gets the cache path.
GetContainingInputPath(NormalizedPath) NormalizedPath
Gets the absolute input path that contains the specified file or directory. If the provided file or directory path is absolute, this returns the input path that contains the specified path (note that the specified file or directory does not need to exist and this just returns the input path that would contain the file or directory based only on path information). If the provided path is relative, this checks all input paths for the existence of the file or directory and returns the first one where it exists.
GetDirectory(NormalizedPath) IDirectory
Gets an absolute directory.
GetFile(NormalizedPath) IFile
Gets an absolute file.
GetFiles(IDirectory, IEnumerable<string>) IEnumerable<IFile>
Gets matching files based on globbing patterns and/or absolute paths. If any absolute paths are provided, only those that actually exist are returned.
GetFiles(IDirectory, string[]) IEnumerable<IFile>
Gets matching files based on globbing patterns and/or absolute paths. If any absolute paths are provided, only those that actually exist are returned.
GetFiles(IEnumerable<string>) IEnumerable<IFile>
Gets matching files based on globbing patterns from the root path or absolute paths.
GetFiles(string[]) IEnumerable<IFile>
Gets matching files based on globbing patterns from the root path or absolute paths.
GetInputDirectories() IEnumerable<IDirectory>
Gets all absolute input directories.
GetInputDirectory(NormalizedPath) IDirectory
Gets a directory representing an input.
GetInputDirectory() IDirectory
Gets the root virtual input directory.
GetInputFile(NormalizedPath) IFile
Gets a file representing an input.
GetInputFiles(IEnumerable<string>) IEnumerable<IFile>
Gets matching input files based on globbing patterns and/or absolute paths. If any absolute paths are provided, only those that actually exist are returned.
GetInputFiles(string[]) IEnumerable<IFile>
Gets matching input files based on globbing patterns and/or absolute paths. If any absolute paths are provided, only those that actually exist are returned.
GetOutputDirectory(NormalizedPath) IDirectory
Gets a directory representing an output.
GetOutputDirectory() IDirectory
Gets a directory representing an output.
GetOutputFile(NormalizedPath) IFile
Gets a file representing an output.
GetOutputPath(NormalizedPath) NormalizedPath
Gets an output path by combining it with the root path and output path.
GetOutputPath() NormalizedPath
Gets the output path.
GetRelativeInputPath(NormalizedPath) NormalizedPath
Gets a path to the specified file relative to it's containing input directory. If no input directories contain this file, then a null path is returned.
GetRelativeOutputPath(NormalizedPath) NormalizedPath
Gets a path to the specified file relative to the output directory. If this path is not relative to the output directory, then a null path is returned.
GetRelativeOutputPathOrSelf(NormalizedPath) NormalizedPath
Gets a path to the specified file relative to the output directory. If this path is not relative to the output directory, then the original path is returned.
GetRootDirectory(NormalizedPath) IDirectory
Gets a directory representing a root directory.
GetRootDirectory() IDirectory
Gets a directory representing a root directory.
GetRootFile(NormalizedPath) IFile
Gets a file representing a root file.
GetRootPath(NormalizedPath) NormalizedPath
Gets a path by combining it with the root path.
GetRootPath() NormalizedPath
Gets the root path.
GetTempDirectory(NormalizedPath) IDirectory
Gets a directory representing temp files.
GetTempDirectory() IDirectory
Gets a directory representing temp files.
GetTempFile(NormalizedPath) IFile
Gets a file representing a temp file.
GetTempFile() IFile
Gets a file representing a temp file with a random file name.
GetTempPath(NormalizedPath) NormalizedPath
Gets a temp path by combining it with the root path and temp path.
GetTempPath() NormalizedPath
Gets the temp path.
GetUnmappedInputPaths(NormalizedPath, HashSet<NormalizedPath>) IEnumerable<NormalizedPath>
Given a relative input path this "unmaps" it for each input path.
ThrowIfNull<IReadOnlyFileSystem>(string) T
ToDocument<IReadOnlyFileSystem>(IContentProvider) IDocument
ToDocument<IReadOnlyFileSystem>(IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
ToDocument<IReadOnlyFileSystem>(NormalizedPath, IContentProvider) IDocument
ToDocument<IReadOnlyFileSystem>(NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
ToDocument<IReadOnlyFileSystem>(NormalizedPath, NormalizedPath, IContentProvider) IDocument
ToDocument<IReadOnlyFileSystem>(NormalizedPath, NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument