use of fish.payara.microprofile.openapi.impl.config.OpenApiConfiguration in project Payara by payara.
the class OpenAPISupplier method filterLibTypes.
private Set<Type> filterLibTypes(OpenApiConfiguration config, Types hk2Types, ReadableArchive archive) {
Set<Type> types = new HashSet<>();
if (config != null && config.getScanLib()) {
Enumeration<String> subArchiveItr = archive.entries();
while (subArchiveItr.hasMoreElements()) {
String subArchiveName = subArchiveItr.nextElement();
if (subArchiveName.startsWith("WEB-INF/lib/") && subArchiveName.endsWith(".jar")) {
try {
ReadableArchive subArchive = archive.getSubArchive(subArchiveName);
types.addAll(Collections.list(subArchive.entries()).stream().filter(clazz -> clazz.endsWith(".class")).map(clazz -> clazz.replace("/", ".").replace(".class", "")).map(clazz -> hk2Types.getBy(clazz)).filter(Objects::nonNull).collect(toSet()));
} catch (IOException ex) {
throw new IllegalStateException(ex);
}
}
}
}
return types;
}
Aggregations