org.hibernate.search.store.spi

## Class DirectoryHelper

- java.lang.Object
- - org.hibernate.search.store.spi.DirectoryHelper

-     public class DirectoryHelper
      extends Object

  Provides utility functions around Lucene directories.
  Author:
    Emmanuel Bernard, Sanne Grinovero, Hardy Ferentschik, Gunnar Morling

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Path` | `getVerifiedIndexPath(String annotatedIndexName, Properties properties, boolean verifyIsWritable)` Verify the index directory exists and is writable, or creates it if not existing.
    `static void` | `initializeIndexIfNeeded(Directory directory)` Initialize the Lucene Directory if it isn't already.

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

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

- - ### Method Detail

    - #### initializeIndexIfNeeded

          public static void initializeIndexIfNeeded(Directory directory)

      Initialize the Lucene Directory if it isn't already.
      Parameters:
        `directory` - the Directory to initialize
      Throws:
        `SearchException` - in case of lock acquisition timeouts, IOException, or if a corrupt index is found

    - #### getVerifiedIndexPath

          public static Path getVerifiedIndexPath(String annotatedIndexName,
                                                  Properties properties,
                                                  boolean verifyIsWritable)

      Verify the index directory exists and is writable, or creates it if not existing.
      Parameters:
        `annotatedIndexName` - The index name declared on the @Indexed annotation
        `properties` - The properties may override the indexname.
        `verifyIsWritable` - Verify the directory is writable
      Returns:
        the Path representing the Index Directory
      Throws:
        `SearchException` - if any.

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved