Table of Contents

Class PhysicalFilesWatcher

Namespace
Acuit.Pinpoint.FileProviders.Physical
Assembly
Acuit.Pinpoint.Configuration.dll

A file watcher that watches a physical filesystem for changes.

Triggers events on IChangeToken when files are created, change, renamed, or deleted.

public class PhysicalFilesWatcher : IDisposable
Inheritance
PhysicalFilesWatcher
Implements
Inherited Members

Constructors

PhysicalFilesWatcher(string, FileSystemWatcher, bool)

Initializes an instance of PhysicalFilesWatcher that watches files in root. Wraps an instance of FileSystemWatcher

public PhysicalFilesWatcher(string root, FileSystemWatcher fileSystemWatcher, bool pollForChanges)

Parameters

root string

Root directory for the watcher

fileSystemWatcher FileSystemWatcher

The wrapped watcher that is watching root

pollForChanges bool

True when the watcher should use polling to trigger instances of IChangeToken created by CreateFileChangeToken(string)

PhysicalFilesWatcher(string, FileSystemWatcher, bool, ExclusionFilters)

Initializes an instance of PhysicalFilesWatcher that watches files in root. Wraps an instance of FileSystemWatcher

public PhysicalFilesWatcher(string root, FileSystemWatcher fileSystemWatcher, bool pollForChanges, ExclusionFilters filters)

Parameters

root string

Root directory for the watcher

fileSystemWatcher FileSystemWatcher

The wrapped watcher that is watching root

pollForChanges bool

True when the watcher should use polling to trigger instances of IChangeToken created by CreateFileChangeToken(string)

filters ExclusionFilters

Specifies which files or directories are excluded. Notifications of changes to are not raised to these.

Methods

CreateFileChangeToken(string)

Creates an instance of IChangeToken for all files and directories that match the filter

Globbing patterns are relative to the root directory given in the constructor PhysicalFilesWatcher(string, FileSystemWatcher, bool). Globbing patterns are interpreted by Matcher.

public IChangeToken CreateFileChangeToken(string filter)

Parameters

filter string

A globbing pattern for files and directories to watch

Returns

IChangeToken

A change token for all files that match the filter

Exceptions

ArgumentNullException

When filter is null

Dispose()

Disposes the file watcher

public void Dispose()