Apache Lucene.Net 2.4.0 Class Library API

Directory Members

Directory overview

Public Static Methods

Copy Copy contents of a directory src to a directory dest. If a file in src already exists in dest then the one in dest will be blindly overwritten.

Public Instance Methods

ClearLock Attempt to clear (forcefully unlock and remove) the specified lock. Only call this at a time when you are certain this lock is no longer in use.
CloseCloses the store.
CreateOutputCreates a new, empty file in the directory with the given name. Returns a stream writing this file.
DeleteFileRemoves an existing file in the directory.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
FileExistsReturns true iff a file with the given name exists.
FileLengthReturns the length of a file in the directory.
FileModifiedReturns the time the named file was last modified.
GetHashCode (inherited from Object)Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table.
GetLockFactory Get the LockFactory that this Directory instance is using for its locking implementation. Note that this may be null for Directory implementations that provide their own locking implementation.
GetLockID Return a string identifier that uniquely differentiates this Directory instance from other Directory instances. This ID should be the same if two Directory instances (even in different JVMs and/or on different machines) are considered "the same index". This is how locking "scopes" to the right index.
GetType (inherited from Object)Gets the Type of the current instance.
ListReturns an array of strings, one for each file in the directory. This method may return null (for example for {@link FSDirectory} if the underlying directory doesn't exist in the filesystem or there are permissions problems).
MakeLockConstruct a {@link Lock}.
OpenInputOverloaded. Returns a stream reading an existing file.
RenameFileRenames an existing file in the directory. If a file already exists with the new name, then it is replaced. This replacement is not guaranteed to be atomic.
SetLockFactory Set the LockFactory that this Directory instance should use for its locking implementation. Each * instance of LockFactory should only be used for one directory (ie, do not share a single instance across multiple Directories).
Sync Ensure that any writes to the file are moved to stable storage. Lucene uses this to properly commit chages to the index, to prevent a machine/OS crash from corrupting the index.
ToString (inherited from Object)Returns a String that represents the current Object.
TouchFileSet the modified time of an existing file to now.

Protected Instance Constructors

Directory Constructor Initializes a new instance of the Directory class.

Protected Instance Methods

Finalize (inherited from Object)Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object)Creates a shallow copy of the current Object.

Protected Internal Instance Fields

isOpen 
lockFactoryHolds the LockFactory instance (implements locking for this Directory instance).

Protected Internal Instance Methods

EnsureOpen Throws AlreadyClosedException if this Directory is closed.

See Also

Directory Class | Lucene.Net.Store Namespace