class JarContentsManager {

    public List<String> findFiles(File jar, String baseDirectoryName,
            String fileName) {
        requireFileExistence(jar);
        Objects.requireNonNull(baseDirectoryName);
        Objects.requireNonNull(fileName);

        try (JarFile jarFile = new JarFile(jar, false)) {
            return jarFile.stream().filter(entry -> !entry.isDirectory())
                    .map(ZipEntry::getName)
                    .filter(path -> path.startsWith(baseDirectoryName))
                    .filter(path -> path
                            .endsWith(JAR_PATH_SEPARATOR + fileName))
                    .collect(Collectors.toList());
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }

}