in opennlp-models-test/src/main/java/org/apache/opennlp/ModelValidator.java [71:78]
public static boolean isModelInJar(Path jarFilePath, String expectedModel) {
try (JarFile jarFile = new JarFile(jarFilePath.toFile())) {
return jarFile.stream()
.anyMatch(entry -> entry.getName().equals(expectedModel));
} catch (IOException e) {
throw new RuntimeException("Failed to read the JAR file: " + jarFilePath, e);
}
}