Xceed .NET Libraries Documentation
Xceed.FileSystem Assembly / Xceed.FileSystem Namespace / ReparsePointTagsFilter Class
Example


In This Topic
    ReparsePointTagsFilter Class
    In This Topic

    Filters a FileSystemItem object based on its ReparsePointTags value.

    Syntax
    'Declaration
     
    
    Public Class ReparsePointTagsFilter 
       Inherits Filter
    'Usage
     
    
    Dim instance As ReparsePointTagsFilter
    public class ReparsePointTagsFilter : Filter 
    Remarks

    By default, the FilterScope is set to File, Folder and Recurse.

    The filter works by obtaining the reparse point tags for the supplied item.

    Then, it performs a bitwise-and operation between the tags and the value of the Mask Property.

    The resulting value is then compared with the value of the ExpectedResult Property. If the values are equal, the filter matches, otherwise, the filter doesn't match.

    The default values of the filter make it so that all name surrogates (symbolic links, hard links, junctions, etc) are filtered out.

    The default mask being ReparseTagNameSurrogate makes the filter isolate the name surrogate bits in the tag value. Then, the expected value of 0 makes the result be true for all items that don't have any name surrogate bits set, and the result be false for all items that do have name surrogate bits set.

    Example
    AbstractFile zipFile = new DiskFile( "ReparsePointTagsFilterExample.zip" );
    
    if( zipFile.Exists )
      zipFile.Delete();
    
    ZipArchive zip = new ZipArchive( zipFile );
    
    /* Notice how we use WindowsDiskFolder here. WindowsDiskFile/WindowsDiskFolder classes
    are able to obtain the reparse point tag values from Windows. Unlike DiskFile/DiskFolder. */
          
    // Select a source folder
    AbstractFolder sourceFolder = new WindowsDiskFolder( @"C:\Users" );
    
    /* The default behavior of the ReparsePointTagsFilter is to exclude reparse
    point name surrogate files and folders when recursing into subfolders */
    
    // Create a reparse point filter
    Filter filters = new ReparsePointTagsFilter();
    
    /* Using the filter when zipping will exclude name surrogate files and folders */
    
    // Apply the reparse point filter when zipping
    sourceFolder.CopyFilesTo( zip, true, true, filters );
          Dim zipFile As AbstractFile = New DiskFile("ReparsePointTagsFilterExample.zip")
    
          If zipFile.Exists Then
            zipFile.Delete()
          End If
    
          Dim zip As New ZipArchive(zipFile)
    
    '       Notice how we use WindowsDiskFolder here. WindowsDiskFile/WindowsDiskFolder classes
    '      are able to obtain the reparse point tag values from Windows. Unlike DiskFile/DiskFolder. 
    
          ' Select a source folder
          Dim sourceFolder As AbstractFolder = New WindowsDiskFolder("C:\Users")
    
    '       The default behavior of the ReparsePointTagsFilter is to exclude reparse
    '      point name surrogate files and folders when recursing into subfolders 
    
          ' Create a reparse point filter
          Dim filters As Filter = New ReparsePointTagsFilter()
    
          ' Using the filter when zipping will exclude name surrogate files and folders 
    
          ' Apply the reparse point filter when zipping
          sourceFolder.CopyFilesTo(zip, True, True, filters)
    reparse point
    Example
    reparse point
    Inheritance Hierarchy

    System.Object
       Xceed.FileSystem.Filter
          Xceed.FileSystem.ReparsePointTagsFilter

    Public Constructors
     NameDescription
    Public ConstructorOverloaded. 

    Filters a FileSystemItem object based on its ReparsePointTags value.

    reparse point  
    Top
    Public Fields
     NameDescription
    Public Fieldstatic (Shared in Visual Basic)ReparsePointTags Enumeration value that is set to the ExpectedResult Property when the object is created.  
    Public Fieldstatic (Shared in Visual Basic)ReparsePointTags value that is set to the Mask Property when the object is created.  
    Public Fieldstatic (Shared in Visual Basic)  
    Top
    Public Properties
     NameDescription
    Public PropertyGets or sets a ReparsePointTags value that defines the target value of the result of the bitwise-and operation between the tag value of an item and the the Mask Property.  
    Public PropertyGets or sets a ReparsePointTags value that determines which bits of the tag value will be taken into account by the filter.  
    Public PropertyGets or sets the scope of the filter. (Inherited from Xceed.FileSystem.Filter)
    Top
    Public Methods
     NameDescription
    Public MethodOverloaded. Overridden. Gets a boolean value indicating if the item matches the filter.  
    Top
    Protected Methods
     NameDescription
    Protected Method  
    Protected MethodRetrieves a boolean value indicating if the specified item is within the scope of the filter. (Inherited from Xceed.FileSystem.Filter)
    Protected Method  
    Top
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Standard: netstandard2.0, netstandard2.1

    .NET Framework: net20, net35, net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also