PhysicalFileProvider Třída

Definice

Vyhledá soubory pomocí souborového systému na disku.Looks up files using the on-disk file system.

public ref class PhysicalFileProvider : IDisposable, Microsoft::Extensions::FileProviders::IFileProvider
public class PhysicalFileProvider : IDisposable, Microsoft.Extensions.FileProviders.IFileProvider
type PhysicalFileProvider = class
    interface IFileProvider
    interface IDisposable
Public Class PhysicalFileProvider
Implements IDisposable, IFileProvider
Dědičnost
PhysicalFileProvider
Implementuje

Poznámky

Pokud je proměnná prostředí "DOTNET_USE_POLLING_FILE_WATCHER" nastavena na "1" nebo "true", volání Watch(String) budou použita PollingFileChangeToken .When the environment variable "DOTNET_USE_POLLING_FILE_WATCHER" is set to "1" or "true", calls to Watch(String) will use PollingFileChangeToken.

Konstruktory

PhysicalFileProvider(String)

Inicializuje novou instanci třídy PhysicalFileProvider v daném kořenovém adresáři.Initializes a new instance of a PhysicalFileProvider at the given root directory.

PhysicalFileProvider(String, ExclusionFilters)

Inicializuje novou instanci třídy PhysicalFileProvider v daném kořenovém adresáři.Initializes a new instance of a PhysicalFileProvider at the given root directory.

Vlastnosti

Root

Kořenový adresář této instance.The root directory for this instance.

UseActivePolling

Získává nebo nastavuje hodnotu, která určuje, jestli se tato instance PhysicalFileProvider aktivně dotazuje na změny souborů.Gets or sets a value that determines if this instance of PhysicalFileProvider actively polls for file changes.

Když true se v nástroji IChangeToken vrátí Watch(String) aktivně cyklické dotazování pro změny souborů ( ActiveChangeCallbacks je true ) místo pasivní.When true, the IChangeToken returned by Watch(String) actively polls for file changes (ActiveChangeCallbacks is true) instead of being passive.

Tato vlastnost je platná pouze v případě UsePollingFileWatcher , kdy je nastavena.This property is only effective when UsePollingFileWatcher is set.

UsePollingFileWatcher

Získává nebo nastavuje hodnotu, která určuje, jestli se tato instance PhysicalFileProvider použití cyklického dotazování na změny souborů určí.Gets or sets a value that determines if this instance of PhysicalFileProvider uses polling to determine file changes.

Ve výchozím nastavení PhysicalFileProvider používá nástroj FileSystemWatcher k naslouchání událostem změny souborů pro Watch(String) .By default, PhysicalFileProvider uses FileSystemWatcher to listen to file change events for Watch(String). FileSystemWatcher v některých scénářích, jako jsou připojené jednotky, není účinná.FileSystemWatcher is ineffective in some scenarios such as mounted drives. Pro efektivní sledování změn souborů se vyžaduje cyklické dotazování.Polling is required to effectively watch for file changes.

Metody

Dispose()

Odstraní zprostředkovatele.Disposes the provider. Po uvolnění poskytovatele se nemusí aktivovat tokeny změny.Change tokens may not trigger after the provider is disposed.

Dispose(Boolean)

Odstraní zprostředkovatele.Disposes the provider.

Equals(Object)

Určí, zda se zadaný objekt rovná aktuálnímu objektu.Determines whether the specified object is equal to the current object.

(Zděděno od Object)
Finalize()

Destruktor pro PhysicalFileProvider .Destructor for PhysicalFileProvider.

GetDirectoryContents(String)

Vytvoří výčet adresáře na dané cestě, pokud existuje.Enumerate a directory at the given path, if any.

GetFileInfo(String)

Vyhledejte soubor v dané cestě přímo mapováním segmentů cesty k fyzickým adresářům.Locate a file at the given path by directly mapping path segments to physical directories.

GetHashCode()

Slouží jako výchozí funkce hash.Serves as the default hash function.

(Zděděno od Object)
GetType()

Získá Type aktuální instanci.Gets the Type of the current instance.

(Zděděno od Object)
MemberwiseClone()

Vytvoří kopii aktuálního seznamu Object .Creates a shallow copy of the current Object.

(Zděděno od Object)
ToString()

Vrátí řetězec, který představuje aktuální objekt.Returns a string that represents the current object.

(Zděděno od Object)
Watch(String)

Vytvoří IChangeToken pro zadanou instanci filter .Creates an IChangeToken for the specified filter.

Vzory expanze názvů jsou interpretovány pomocí Matcher .Globbing patterns are interpreted by Matcher.

Platí pro