use of org.jboss.jandex.UnsupportedVersion in project core by weld.
the class JandexIndexBeanArchiveHandler method getIndex.
private Index getIndex(final File beanArchiveFile) {
Preconditions.checkArgumentNotNull(beanArchiveFile, "beanArchiveFile");
logger.debugv("Try to get Jandex index for: {0}", beanArchiveFile);
Index index = null;
try (ZipFile zip = new ZipFile(beanArchiveFile)) {
// Open the bean archive and try to find the index file
ZipEntry entry = zip.getEntry(JANDEX_INDEX_NAME);
if (entry != null) {
index = new IndexReader(zip.getInputStream(entry)).read();
}
} catch (IllegalArgumentException e) {
CommonLogger.LOG.warnv("Jandex index is not valid: {0}", beanArchiveFile);
} catch (UnsupportedVersion e) {
CommonLogger.LOG.warnv("Version of Jandex index is not supported: {0}", beanArchiveFile);
} catch (IOException e) {
CommonLogger.LOG.warnv("Cannot get Jandex index from: {0}", beanArchiveFile);
CommonLogger.LOG.catchingDebug(e);
}
logger.debugv("Jandex index {0}found: {1}", index == null ? "NOT " : "", beanArchiveFile);
return index;
}
Aggregations