public final class DirectoryProviderHelper extends Object
Modifier and Type | Method and Description |
---|---|
static FSDirectory |
createFSIndex(File 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)
Users may configure the number of MB to use as
"chunk size" for large file copy operations performed
by DirectoryProviders.
|
static File |
getSourceDirectory(String indexName,
Properties properties,
boolean needWritePermissions)
Deprecated.
Use getSourceDirectoryPath
|
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(File directory,
String indexName,
boolean verifyIsWritable)
Deprecated.
Use makeSanityCheckedDirectory(Path directory, String indexName, boolean verifyIsWritable)
|
static void |
makeSanityCheckedDirectory(Path directory,
String indexName,
boolean verifyIsWritable) |
@Deprecated public static File getSourceDirectory(String indexName, Properties properties, boolean needWritePermissions)
indexName
- the name of the index (directory) to createproperties
- the configuration propertiesneedWritePermissions
- when true the directory will be tested for read-write permissions.public static Path getSourceDirectoryPath(String indexName, Properties properties, boolean needWritePermissions)
indexName
- the name of the index (directory) to createproperties
- the configuration propertiesneedWritePermissions
- when true the directory will be tested for read-write permissions.public static FSDirectory createFSIndex(File indexDir, Properties properties, ServiceManager serviceManager) throws IOException
indexDir
- the directory where to write a new indexproperties
- the configuration propertiesserviceManager
- provides access to servicesFSDirectory
instanceIOException
- if an errorpublic static void makeSanityCheckedDirectory(Path directory, String indexName, boolean verifyIsWritable)
directory
- The directory to create or verifyindexName
- To label exceptionsverifyIsWritable
- Verify the directory is writableSearchException
- if the index cannot be created, it's not a directory or it's not writeable@Deprecated public static void makeSanityCheckedDirectory(File directory, String indexName, boolean verifyIsWritable)
directory
- The directory to create or verifyindexName
- To label exceptionsverifyIsWritable
- Verify the directory is writablepublic static long getCopyBufferSize(String indexName, Properties properties)
indexName
- the index nameproperties
- the configuration propertiesCopyright © 2006-2017 Red Hat, Inc. All Rights Reserved