public class DirectoryHelper extends Object
Modifier and Type | Method and Description |
---|---|
static File |
getVerifiedIndexDir(String annotatedIndexName,
Properties properties,
boolean verifyIsWritable)
|
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.
|
public static void initializeIndexIfNeeded(Directory directory)
directory
- the Directory to initializeSearchException
- in case of lock acquisition timeouts, IOException, or if a corrupt index is foundpublic static Path getVerifiedIndexPath(String annotatedIndexName, Properties properties, boolean verifyIsWritable)
annotatedIndexName
- The index name declared on the @Indexed annotationproperties
- The properties may override the indexname.verifyIsWritable
- Verify the directory is writableSearchException
- if any.@Deprecated public static File getVerifiedIndexDir(String annotatedIndexName, Properties properties, boolean verifyIsWritable)
annotatedIndexName
- The index name declared on the @Indexed annotationproperties
- The properties may override the indexname.verifyIsWritable
- Verify the directory is writableCopyright © 2006-2017 Red Hat, Inc. All Rights Reserved