Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class TrackingDirectoryWrapper

    A delegating Directory that records which files were written to and deleted.

    Inheritance
    object
    Directory
    FilterDirectory
    TrackingDirectoryWrapper
    Implements
    IDisposable
    Inherited Members
    FilterDirectory.Delegate
    FilterDirectory.ListAll()
    FilterDirectory.FileExists(string)
    FilterDirectory.FileLength(string)
    FilterDirectory.Sync(ICollection<string>)
    FilterDirectory.OpenInput(string, IOContext)
    FilterDirectory.MakeLock(string)
    FilterDirectory.ClearLock(string)
    FilterDirectory.SetLockFactory(LockFactory)
    FilterDirectory.GetLockID()
    FilterDirectory.LockFactory
    FilterDirectory.ToString()
    Directory.OpenChecksumInput(string, IOContext)
    Directory.Dispose()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Store
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class TrackingDirectoryWrapper : FilterDirectory, IDisposable

    Constructors

    TrackingDirectoryWrapper(Directory)

    A delegating Directory that records which files were written to and deleted.

    Declaration
    public TrackingDirectoryWrapper(Directory @in)
    Parameters
    Type Name Description
    Directory in

    Properties

    CreatedFiles

    A delegating Directory that records which files were written to and deleted.

    Declaration
    public ISet<string> CreatedFiles { get; }
    Property Value
    Type Description
    ISet<string>

    Methods

    Copy(Directory, string, string, IOContext)

    Copies the file src to Directoryto under the new file name dest.

    If you want to copy the entire source directory to the destination one, you can do so like this:
    Directory to; // the directory to copy to
    foreach (string file in dir.ListAll()) {
        dir.Copy(to, file, newFile, IOContext.DEFAULT); // newFile can be either file, or a new name
    }

    NOTE: this method does not check whether dest exist and will

    overwrite it if it does.

    Declaration
    public override void Copy(Directory to, string src, string dest, IOContext context)
    Parameters
    Type Name Description
    Directory to
    string src
    string dest
    IOContext context
    Overrides
    Directory.Copy(Directory, string, string, IOContext)

    CreateOutput(string, IOContext)

    Creates a new, empty file in the directory with the given name. Returns a stream writing this file.

    Declaration
    public override IndexOutput CreateOutput(string name, IOContext context)
    Parameters
    Type Name Description
    string name
    IOContext context
    Returns
    Type Description
    IndexOutput
    Overrides
    FilterDirectory.CreateOutput(string, IOContext)

    CreateSlicer(string, IOContext)

    Creates an Directory.IndexInputSlicer for the given file name. Directory.IndexInputSlicer allows other Directory implementations to efficiently open one or more sliced IndexInput instances from a single file handle. The underlying file handle is kept open until the Directory.IndexInputSlicer is closed.

    Throws FileNotFoundException if the file does not exist.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public override Directory.IndexInputSlicer CreateSlicer(string name, IOContext context)
    Parameters
    Type Name Description
    string name
    IOContext context
    Returns
    Type Description
    Directory.IndexInputSlicer
    Overrides
    Directory.CreateSlicer(string, IOContext)
    Exceptions
    Type Condition
    IOException

    if an IOException occurs

    DeleteFile(string)

    Removes an existing file in the directory.

    Declaration
    public override void DeleteFile(string name)
    Parameters
    Type Name Description
    string name
    Overrides
    FilterDirectory.DeleteFile(string)

    Implements

    IDisposable
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.