}
public static BoboMultiReader getBoboIndexReader(Directory idxDir) throws BrowseException {
try {
if (!BoboMultiReader.indexExists(idxDir)) {
throw new BrowseException("Index does not exist at: " + idxDir);
}
} catch (IOException ioe) {
throw new BrowseException(ioe.getMessage(), ioe);
}
DirectoryReader reader = null;
try {
reader = DirectoryReader.open(idxDir);
} catch (IOException ioe) {
throw new BrowseException(ioe.getMessage(), ioe);
}
BoboMultiReader bReader = null;
try {
bReader = BoboMultiReader.getInstance(reader);
} catch (IOException ioe) {
if (reader != null) {
try {
reader.close();
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
}
throw new BrowseException(ioe.getMessage(), ioe);
}
return bReader;
}