public final void findCallingMethodsInJar(final File file) throws IOException {

        try (final JarFile jarFile = new JarFile(file)) {

            final Enumeration<JarEntry> entries = jarFile.entries();

            while (entries.hasMoreElements()) {
                final JarEntry entry = entries.nextElement();

                if (entry.getName().endsWith(".class")) {
                    final InputStream in = new BufferedInputStream(jarFile.getInputStream(entry), 1024);
                    try {
                        new ClassReader(in).accept(cv, 0);
                    } finally {
                        in.close();
                    }
                }
            }

        }
    }
public final void findCallingMethodsInJar ( final File file ) throws IOException { try ( final JarFile jarFile = new JarFile ( file ) ) { final Enumeration < JarEntry > entries = jarFile . entries ( ) ; while ( entries . hasMoreElements ( ) ) { final JarEntry entry = entries . nextElement ( ) ; if ( entry . getName ( ) . endsWith ( ".class" ) ) { final InputStream in = new BufferedInputStream ( jarFile . getInputStream ( entry ) , 1024 ) ; try { new ClassReader ( in ) . accept ( cv , 0 ) ; } finally { in . close ( ) ; } } } } }
Locate method calls in classes of a JAR file.

@param file
File to search.

@throws IOException
Error reading the file.