throw new IOException("directory " + directory + " does not have a metadata.txt and is not a lucene index");
}
final ParallelReader pReader = new ParallelReader();
pReader.add(luceneIndex);
final int maxDoc = luceneIndex.maxDoc();
<BUG>final File[] files = new File(directory).listFiles();
</BUG>
if (files != null) {
for (final File file : files) {
if (!file.isDirectory() || !IndexReader.indexExists(file)) {

throw new IOException("directory " + directory + " does not have a metadata.txt and is not a lucene index");
}
final ParallelReader pReader = new ParallelReader();
pReader.add(luceneIndex);
final int maxDoc = luceneIndex.maxDoc();
final File[] files = indexDir.listFiles();
if (files != null) {
for (final File file : files) {
if (!file.isDirectory() || !IndexReader.indexExists(file)) {
