org.apache.solr.core

## Class MockDirectoryFactory

- java.lang.Object
- - org.apache.solr.core.DirectoryFactory
  - - org.apache.solr.core.CachingDirectoryFactory
    - - org.apache.solr.core.EphemeralDirectoryFactory
      - - org.apache.solr.core.MockDirectoryFactory

- All Implemented Interfaces:
    Closeable, AutoCloseable, org.apache.solr.util.plugin.NamedListInitializedPlugin

      public class MockDirectoryFactory
      extends org.apache.solr.core.EphemeralDirectoryFactory

  Opens a directory with `LuceneTestCase.newDirectory()`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.solr.core.CachingDirectoryFactory

      `org.apache.solr.core.CachingDirectoryFactory.CacheValue, org.apache.solr.core.CachingDirectoryFactory.CloseListener`

    - ### Nested classes/interfaces inherited from class org.apache.solr.core.DirectoryFactory

      `org.apache.solr.core.DirectoryFactory.DirContext`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `SOLR_TESTS_ALLOW_READING_FILES_STILL_OPEN_FOR_WRITE`

    - ### Fields inherited from class org.apache.solr.core.CachingDirectoryFactory

      `byDirectoryCache, byPathCache, closeListeners, removeEntries`

    - ### Fields inherited from class org.apache.solr.core.DirectoryFactory

      `coreContainer, INDEX_W_TIMESTAMP_REGEX, IOCONTEXT_NO_CACHE, LOCK_TYPE_HDFS, LOCK_TYPE_NATIVE, LOCK_TYPE_NONE, LOCK_TYPE_SIMPLE, LOCK_TYPE_SINGLE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MockDirectoryFactory()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected org.apache.lucene.store.Directory` | `create(String path, org.apache.lucene.store.LockFactory lockFactory, org.apache.solr.core.DirectoryFactory.DirContext dirContext)`
    `protected org.apache.lucene.store.LockFactory` | `createLockFactory(String rawLockType)`
    `boolean` | `isAbsolute(String path)`

    - ### Methods inherited from class org.apache.solr.core.EphemeralDirectoryFactory

      `exists, isPersistent, remove, remove`

    - ### Methods inherited from class org.apache.solr.core.CachingDirectoryFactory

      `addCloseListener, close, deleteOldIndexDirectory, doneWithDirectory, get, getLivePaths, getPath, incRef, init, normalize, release, remove, remove, removeDirectory, stripTrailingSlash`

    - ### Methods inherited from class org.apache.solr.core.DirectoryFactory

      `cleanupOldIndexDirectories, empty, getDataHome, initCoreContainer, isSharedStorage, move, offerMBeans, searchersReserveCommitPoints, size, size, sizeOf, sizeOfDirectory`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SOLR_TESTS_ALLOW_READING_FILES_STILL_OPEN_FOR_WRITE

          public static final String SOLR_TESTS_ALLOW_READING_FILES_STILL_OPEN_FOR_WRITE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MockDirectoryFactory

          public MockDirectoryFactory()

  - ### Method Detail

    - #### createLockFactory

          protected org.apache.lucene.store.LockFactory createLockFactory(String rawLockType)
                                                                   throws IOException

      Specified by:
        `createLockFactory` in class `org.apache.solr.core.DirectoryFactory`
      Throws:
        `IOException`

    - #### create

          protected org.apache.lucene.store.Directory create(String path,
                                                             org.apache.lucene.store.LockFactory lockFactory,
                                                             org.apache.solr.core.DirectoryFactory.DirContext dirContext)
                                                      throws IOException

      Specified by:
        `create` in class `org.apache.solr.core.DirectoryFactory`
      Throws:
        `IOException`

    - #### isAbsolute

          public boolean isAbsolute(String path)

      Overrides:
        `isAbsolute` in class `org.apache.solr.core.EphemeralDirectoryFactory`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.