The FSDirectory type exposes the following members.

Constructors

  NameDescription
Protected methodFSDirectory()()()() Obsolete.
Initializes a new instance of the FSDirectory class
Protected methodFSDirectory(DirectoryInfo, LockFactory)
Create a new FSDirectory for the named location (ctor for subclasses).

Methods

  NameDescription
Public methodClearLock
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.
(Inherited from Directory.)
Public methodClose
Closes the store to future operations.
(Overrides Directory..::..Close()()()().)
Public methodCreateOutput
Creates an IndexOutput for the file with the given name. In 3.0 this method will become abstract.
(Overrides Directory..::..CreateOutput(String).)
Public methodDeleteFile
Removes an existing file in the directory.
(Overrides Directory..::..DeleteFile(String).)
Public methodDispose
.NET
(Overrides Directory..::..Dispose()()()().)
Public methodEnsureOpen (Inherited from Directory.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFileExists
Returns true iff a file with the given name exists.
(Overrides Directory..::..FileExists(String).)
Public methodFileLength
Returns the length in bytes of a file in the directory.
(Overrides Directory..::..FileLength(String).)
Public methodFileModified(String)
Returns the time the named file was last modified.
(Overrides Directory..::..FileModified(String).)
Public methodStatic memberFileModified(FileInfo, String)
Returns the time the named file was last modified.
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetDirectory()()()()
Public methodStatic memberGetDirectory(DirectoryInfo) Obsolete.
Returns the directory instance for the named location.
Public methodStatic memberGetDirectory(FileInfo) Obsolete.
Returns the directory instance for the named location.
Public methodStatic memberGetDirectory(String) Obsolete.
Returns the directory instance for the named location.
Public methodStatic memberGetDirectory(DirectoryInfo, LockFactory) Obsolete.
Returns the directory instance for the named location.
Public methodStatic memberGetDirectory(DirectoryInfo, Boolean) Obsolete.
Returns the directory instance for the named location.
Public methodStatic memberGetDirectory(FileInfo, LockFactory) Obsolete.
Returns the directory instance for the named location.
Public methodStatic memberGetDirectory(FileInfo, Boolean) Obsolete.
Returns the directory instance for the named location.
Public methodStatic memberGetDirectory(String, LockFactory) Obsolete.
Returns the directory instance for the named location.
Public methodStatic memberGetDirectory(String, Boolean) Obsolete.
Returns the directory instance for the named location.
Public methodStatic memberGetDisableLocks Obsolete.
Returns whether Lucene's use of lock files is disabled.
Public methodGetFile Obsolete.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLockFactory
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.
(Inherited from Directory.)
Public methodGetLockID (Overrides Directory..::..GetLockID()()()().)
Public methodGetReadChunkSize
The maximum number of bytes to read at once from the underlying file during {@link IndexInput#readBytes}.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodInitOutput
Initializes the directory to create a new file with the given name. This method should be used in {@link #createOutput}.
Public methodList Obsolete. (Overrides Directory..::..List()()()().)
Public methodListAll()()()()
Lists all files (not subdirectories) in the directory.
(Overrides Directory..::..ListAll()()()().)
Public methodStatic memberListAll(DirectoryInfo)
Lists all files (not subdirectories) in the directory. This method never returns null (throws {@link IOException} instead).
Public methodStatic memberListAll(FileInfo) Obsolete.
Lists all files (not subdirectories) in the directory. This method never returns null (throws {@link IOException} instead).
Public methodMakeLock
Construct a {@link Lock}.
(Inherited from Directory.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberOpen(DirectoryInfo)
Creates an FSDirectory instance, trying to pick the best implementation given the current environment. The directory returned uses the {@link NativeFSLockFactory}.

Currently this returns {@link SimpleFSDirectory} as NIOFSDirectory is currently not supported.

NOTE: this method may suddenly change which implementation is returned from release to release, in the event that higher performance defaults become possible; if the precise implementation is important to your application, please instantiate it directly, instead. On 64 bit systems, it may also good to return {@link MMapDirectory}, but this is disabled because of officially missing unmap support in Java. For optimal performance you should consider using this implementation on 64 bit JVMs.

See above

Public methodStatic memberOpen(FileInfo) Obsolete.
Creates an FSDirectory instance, trying to pick the best implementation given the current environment. The directory returned uses the {@link NativeFSLockFactory}.

Currently this returns {@link SimpleFSDirectory} as NIOFSDirectory is currently not supported.

Currently this returns {@link SimpleFSDirectory} as NIOFSDirectory is currently not supported.

NOTE: this method may suddenly change which implementation is returned from release to release, in the event that higher performance defaults become possible; if the precise implementation is important to your application, please instantiate it directly, instead. On 64 bit systems, it may also good to return {@link MMapDirectory}, but this is disabled because of officially missing unmap support in Java. For optimal performance you should consider using this implementation on 64 bit JVMs.

See above

Public methodStatic memberOpen(DirectoryInfo, LockFactory)
Just like {@link #Open(File)}, but allows you to also specify a custom {@link LockFactory}.
Public methodOpenInput(String) (Overrides Directory..::..OpenInput(String).)
Public methodOpenInput(String, Int32)
Creates an IndexInput for the file with the given name. In 3.0 this method will become abstract.
(Overrides Directory..::..OpenInput(String, Int32).)
Public methodRenameFile Obsolete.
Renames an existing file in the directory. Warning: This is not atomic.
(Overrides Directory..::..RenameFile(String, String).)
Public methodStatic memberSetDisableLocks Obsolete.
Set whether Lucene's use of lock files is disabled. By default, lock files are enabled. They should only be disabled if the index is on a read-only medium like a CD-ROM.
Public methodSetLockFactory
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).
(Inherited from Directory.)
Public methodSetReadChunkSize
Sets the maximum number of bytes read at once from the underlying file during {@link IndexInput#readBytes}. The default value is {@link #DEFAULT_READ_CHUNK_SIZE};

This was introduced due to Sun JVM Bug 6478546, which throws an incorrect OutOfMemoryError when attempting to read too many bytes at once. It only happens on 32bit JVMs with a large maximum heap size.

Changes to this value will not impact any already-opened {@link IndexInput}s. You should call this before attempting to open an index on the directory.

NOTE: This value should be as large as possible to reduce any possible performance impact. If you still encounter an incorrect OutOfMemoryError, trying lowering the chunk size.

Public methodSync (Overrides Directory..::..Sync(String).)
Public methodToString
For debug output.
(Overrides Directory..::..ToString()()()().)
Public methodTouchFile
Set the modified time of an existing file to now.
(Overrides Directory..::..TouchFile(String).)

Fields

  NameDescription
Public fieldStatic memberDEFAULT_READ_CHUNK_SIZE
Default read chunk size. This is a conditional default: on 32bit JVMs, it defaults to 100 MB. On 64bit JVMs, it's
CopyC#
Integer.MAX_VALUE
.
Protected fielddirectory
The underlying filesystem directory
Protected fieldisOpen (Inherited from Directory.)
Protected fieldlockFactory
Holds the LockFactory instance (implements locking for this Directory instance).
(Inherited from Directory.)

Properties

  NameDescription
Public propertyisOpen_ForNUnit (Inherited from Directory.)

See Also