DirectoryEnumerationFilters Class |
Inheritance HierarchySystemObject Alphaleonis.Win32.FilesystemDirectoryEnumerationFilters
Namespace:
Alphaleonis.Win32.Filesystem
Assembly:
AlphaFS (in AlphaFS.dll) Version: 2.2
Syntaxpublic class DirectoryEnumerationFilters
Public Class DirectoryEnumerationFilters
public ref class DirectoryEnumerationFilters
type DirectoryEnumerationFilters = class end
The DirectoryEnumerationFilters type exposes the following members.
Constructors
Properties
| Name | Description |
---|
![Public property Public property](../icons/pubproperty.gif) | CancellationToken | Gets or sets the cancellation token to abort the enumeration. |
![Public property Public property](../icons/pubproperty.gif) | ErrorFilter | Gets or sets the filter that returns if the input error should not be thrown. |
![Public property Public property](../icons/pubproperty.gif) | InclusionFilter | Gets or sets the filter that returns if the input file system entry should be included in the enumeration. |
![Public property Public property](../icons/pubproperty.gif) | RecursionFilter | Gets or sets the filter that returns if the input directory should be recursively traversed. |
Top
Methods
| Name | Description |
---|
![Public method Public method](../icons/pubmethod.gif) | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![Protected method Protected method](../icons/protmethod.gif) | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![Public method Public method](../icons/pubmethod.gif) | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![Public method Public method](../icons/pubmethod.gif) | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![Protected method Protected method](../icons/protmethod.gif) | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![Public method Public method](../icons/pubmethod.gif) | ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
RemarksDirectoryEnumerationFilters allows scenarios in which files/directories being
enumerated by the methods of
Directory class are accepted only if
they match the search pattern, attributes (see
SkipReparsePoints),
and optionally also the custom criteria tested in the method whose delegate is specified in
InclusionFilter.
These criteria could be, e.g., file size exceeding some threshold, pathname matches a compex regular expression, etc.
If the enumeration process is set to be recursive (see
Recursive) and
RecursionFilter
is specified, the directory is traversed recursively only if it matches the custom criteria in
RecursionFilter
method. This allows, for example, custom handling of junctions and symbolic links, e.g., detection of cycles.
If any error occurs during the enumeration and the enumeration process is not set to ignore errors
(see
ContinueOnException), an exception is thrown unless
the error is handled (filtered out) by the method specified in
ErrorFilter (if specified).
The method may, for example, consume the error by reporting it in a log, so that the enumeration continues
as in the case of
ContinueOnException option but the user will be informed about errors.
See Also