org.hibernate.search.store.impl

## Class DirectoryProviderHelper

- java.lang.Object
- - org.hibernate.search.store.impl.DirectoryProviderHelper

-     public final class DirectoryProviderHelper
      extends Object

  Author:
    Emmanuel Bernard, Sanne Grinovero, Hardy Ferentschik

- - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static FSDirectory` | `createFSIndex(Path indexDir, Properties properties, ServiceManager serviceManager)` Creates an FSDirectory in provided directory and initializes an index if not already existing.
    `static long` | `getCopyBufferSize(String indexName, Properties properties)` Deprecated. the configured chunk size is actually no longer useful and will be ignored.
    `static Path` | `getSourceDirectoryPath(String indexName, Properties properties, boolean needWritePermissions)` Build a directory name out of a root and relative path, guessing the significant part and checking for the file availability
    `static void` | `makeSanityCheckedDirectory(Path directory, String indexName, boolean verifyIsWritable)`

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

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

- - ### Method Detail

    - #### getSourceDirectoryPath

          public static Path getSourceDirectoryPath(String indexName,
                                                    Properties properties,
                                                    boolean needWritePermissions)

      Build a directory name out of a root and relative path, guessing the significant part and checking for the file availability
      Parameters:
        `indexName` - the name of the index (directory) to create
        `properties` - the configuration properties
        `needWritePermissions` - when true the directory will be tested for read-write permissions.
      Returns:
        The file representing the source directory

    - #### createFSIndex

          public static FSDirectory createFSIndex(Path indexDir,
                                                  Properties properties,
                                                  ServiceManager serviceManager)
                                           throws IOException

      Creates an FSDirectory in provided directory and initializes an index if not already existing.
      Parameters:
        `indexDir` - the directory where to write a new index
        `properties` - the configuration properties
        `serviceManager` - provides access to services
      Returns:
        the created `FSDirectory` instance
      Throws:
        `IOException` - if an error

    - #### makeSanityCheckedDirectory

          public static void makeSanityCheckedDirectory(Path directory,
                                                        String indexName,
                                                        boolean verifyIsWritable)

      Parameters:
        `directory` - The directory to create or verify
        `indexName` - To label exceptions
        `verifyIsWritable` - Verify the directory is writable
      Throws:
        `SearchException` - if the index cannot be created, it's not a directory or it's not writeable

    - #### getCopyBufferSize

          @Deprecated
          public static long getCopyBufferSize(String indexName,
                                                           Properties properties)

      Deprecated. the configured chunk size is actually no longer useful and will be ignored.
      Users may configure the number of MB to use as "chunk size" for large file copy operations performed by DirectoryProviders.
      Parameters:
        `indexName` - the index name
        `properties` - the configuration properties
      Returns:
        the number of Bytes to use as "chunk size" in file copy operations.

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