public JarAnalyzer()

in src/main/java/org/apache/maven/shared/jar/JarAnalyzer.java [99:122]


    public JarAnalyzer(File file) throws IOException {
        try {
            this.jarFile = new JarFile(file);
        } catch (ZipException e) {
            ZipException ioe = new ZipException("Failed to open file " + file + " : " + e.getMessage());
            ioe.initCause(e);
            throw ioe;
        }

        // Obtain entries list.
        List<JarEntry> entries = Collections.list(jarFile.entries());

        // Sorting of list is done by name to ensure a bytecode hash is always consistent.
        entries.sort(Comparator.comparing(ZipEntry::getName));

        Manifest manifest;
        try {
            manifest = jarFile.getManifest();
        } catch (IOException e) {
            closeQuietly();
            throw e;
        }
        this.jarData = new JarData(file, manifest, entries);
    }