public class LuceneDirectoryUtilsImpl extends Object implements LuceneDirectoryUtils
Constructor and Description |
---|
LuceneDirectoryUtilsImpl() |
Modifier and Type | Method and Description |
---|---|
void |
createDirRobust(String path)
Creates a directory (robustly) or throws appropriate Exception
|
org.apache.lucene.store.Directory |
getDirectory(File path)
Creates an index directory for the given path on the filesystem.
|
Collection<String> |
getLocks(String path) |
Collection<String> |
getStaleLockPaths(Collection<String> indexDirectoryPaths)
Given a
Collection of paths that represent index directories checks if there are any existing
Lucene lock files for the passed paths. |
public org.apache.lucene.store.Directory getDirectory(File path)
LuceneDirectoryUtils
getDirectory
in interface LuceneDirectoryUtils
path
- to the index directory.Directory
public void createDirRobust(String path) throws IOException
LuceneDirectoryUtils
createDirRobust
in interface LuceneDirectoryUtils
path
- Lucene index directory pathIOException
- if cannot create directory, write to the directory, or not a directorypublic Collection<String> getStaleLockPaths(Collection<String> indexDirectoryPaths)
LuceneDirectoryUtils
Collection
of paths that represent index directories checks if there are any existing
Lucene lock files for the passed paths. This method returns a Collection
of file paths of any existing
Lucene lock files. If no lock files are found an empty collection is returned.
A common usage of this methdo would be:
Collection existingLockFilepaths = LuceneUtils.getStaleLockPaths(indexManager.getAllIndexPaths());
getStaleLockPaths
in interface LuceneDirectoryUtils
indexDirectoryPaths
- collection of index directory pathspublic Collection<String> getLocks(String path) throws IOException
IOException
Copyright © 2002-2017 Atlassian. All Rights Reserved.