Class PhysicalFileProvider
- Namespace
- Acuit.Pinpoint.FileProviders
- Assembly
- Acuit.Pinpoint.Configuration.dll
Looks up files using the on-disk file system
public class PhysicalFileProvider : IFileProvider, IDisposable
- Inheritance
-
PhysicalFileProvider
- Implements
- Inherited Members
Remarks
When the environment variable "DOTNET_USE_POLLING_FILE_WATCHER" is set to "1" or "true", calls to Watch(string) will use PollingFileChangeToken.
Constructors
PhysicalFileProvider(string)
Initializes a new instance of a PhysicalFileProvider at the given root directory.
public PhysicalFileProvider(string root)
Parameters
rootstringThe root directory. This should be an absolute path.
PhysicalFileProvider(string, ExclusionFilters)
Initializes a new instance of a PhysicalFileProvider at the given root directory.
public PhysicalFileProvider(string root, ExclusionFilters filters)
Parameters
rootstringThe root directory. This should be an absolute path.
filtersExclusionFiltersSpecifies which files or directories are excluded.
Properties
Root
The root directory for this instance.
public string Root { get; }
Property Value
Methods
Dispose()
Disposes the provider. Change tokens may not trigger after the provider is disposed.
public void Dispose()
GetDirectoryContents(string)
Enumerate a directory at the given path, if any.
public IDirectoryContents GetDirectoryContents(string subpath)
Parameters
subpathstringA path under the root directory. Leading slashes are ignored.
Returns
- IDirectoryContents
Contents of the directory. Caller must check Exists property. NotFoundDirectoryContents if
subpathis absolute, if the directory does not exist, orsubpathhas invalid characters.
GetFileInfo(string)
Locate a file at the given path by directly mapping path segments to physical directories.
public IFileInfo GetFileInfo(string subpath)
Parameters
subpathstringA path under the root directory
Returns
Watch(string)
Creates a IChangeToken for the specified filter.
Globbing patterns are interpreted by Matcher.
public IChangeToken Watch(string filter)
Parameters
filterstringFilter string used to determine what files or folders to monitor. Example: /*.cs, ., subFolder//*.cshtml.
Returns
- IChangeToken
An IChangeToken that is notified when a file matching
filteris added, modified or deleted. Returns a NullChangeToken iffilterhas invalid filter characters or iffilteris an absolute path or outside the root directory specified in the constructor PhysicalFileProvider(string).