Table of Contents

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 string

The 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 string

The root directory. This should be an absolute path.

filters ExclusionFilters

Specifies which files or directories are excluded.

Properties

Root

The root directory for this instance.

public string Root { get; }

Property Value

string

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 string

A 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, or subpath 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 string

A path under the root directory

Returns

IFileInfo

The file information. Caller must check Exists property.

Watch(string)

Creates a IChangeToken for the specified filter.

Globbing patterns are interpreted by Matcher.

public IChangeToken Watch(string filter)

Parameters

filter string

Filter 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 if filter has invalid filter characters or if filter is an absolute path or outside the root directory specified in the constructor PhysicalFileProvider(string).