PhysicalFileProvider PhysicalFileProvider PhysicalFileProvider Class

Definition

Looks up files using the on-disk file system

public class PhysicalFileProvider : IDisposable, Microsoft.Extensions.FileProviders.IFileProvider
type PhysicalFileProvider = class
    interface IFileProvider
    interface IDisposable
Public Class PhysicalFileProvider
Implements IDisposable, IFileProvider
Inheritance
PhysicalFileProviderPhysicalFileProviderPhysicalFileProvider
Implements

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) PhysicalFileProvider(String) PhysicalFileProvider(String)

Initializes a new instance of a PhysicalFileProvider at the given root directory.

PhysicalFileProvider(String, ExclusionFilters) PhysicalFileProvider(String, ExclusionFilters) PhysicalFileProvider(String, ExclusionFilters)

Initializes a new instance of a PhysicalFileProvider at the given root directory.

Properties

Root Root Root

The root directory for this instance.

UseActivePolling UseActivePolling UseActivePolling

Gets or sets a value that determines if this instance of PhysicalFileProvider actively polls for file changes.

When true, IChangeToken returned by Watch(String) will actively poll for file changes (ActiveChangeCallbacks will be true) instead of being passive.

This property is only effective when UsePollingFileWatcher is set.

UsePollingFileWatcher UsePollingFileWatcher UsePollingFileWatcher

Gets or sets a value that determines if this instance of PhysicalFileProvider uses polling to determine file changes.

By default, PhysicalFileProvider uses FileSystemWatcher to listen to file change events for Watch(String). FileSystemWatcher is ineffective in some scenarios such as mounted drives. Polling is required to effectively watch for file changes.

.

Methods

Dispose() Dispose() Dispose()

Disposes the provider. Change tokens may not trigger after the provider is disposed.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Disposes the provider.

Finalize() Finalize() Finalize()

Destructor for PhysicalFileProvider.

GetDirectoryContents(String) GetDirectoryContents(String) GetDirectoryContents(String)

Enumerate a directory at the given path, if any.

GetFileInfo(String) GetFileInfo(String) GetFileInfo(String)

Locate a file at the given path by directly mapping path segments to physical directories.

Watch(String) Watch(String) Watch(String)

Creates a IChangeToken for the specified filter.

Globbing patterns are interpreted by .

Applies to