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
root
stringThe 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
root
stringThe root directory. This should be an absolute path.
filters
ExclusionFiltersSpecifies 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
subpath
stringA path under the root directory. Leading slashes are ignored.
Returns
- IDirectoryContents
Contents of the directory. Caller must check Exists property. NotFoundDirectoryContents if
subpath
is absolute, if the directory does not exist, orsubpath
has 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
subpath
stringA 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
filter
stringFilter 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
filter
is added, modified or deleted. Returns a NullChangeToken iffilter
has invalid filter characters or iffilter
is an absolute path or outside the root directory specified in the constructor PhysicalFileProvider(string).