Class TrackingDirectoryWrapper
A delegating Directory that records which files were written to and deleted.
Implements
Inherited Members
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
.
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
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
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
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 |