org.apache.lucene.store

Class Directory

  • All Implemented Interfaces:
    Closeable, AutoCloseable
    Direct Known Subclasses:
    BaseDirectory, FileSwitchDirectory, FilterDirectory


    public abstract class Directory
    extends Object
    implements Closeable
    A Directory is a flat list of files. Files may be written once, when they are created. Once a file is created it may only be opened for read, or deleted. Random access is permitted both when reading and writing.

    Java's i/o APIs not used directly, but rather all i/o is through this API. This permits things such as:

    • implementation of RAM-based indices;
    • implementation indices stored in a database, via JDBC;
    • implementation of an index as a single file;
    Directory locking is implemented by an instance of LockFactory.