String packagePath,
ByteCodeClassScanner classScanner,
JarByteCodeMatcher matcher)
{
ZipFile zipFile = null;
Jar jar = JarPath.create(path).getJar();
try {
zipFile = jar.getZipFile();
if (zipFile == null)
return;
Enumeration<? extends ZipEntry> e = zipFile.entries();
while (e.hasMoreElements()) {
ZipEntry entry = e.nextElement();
String entryName = entry.getName();
if (! entryName.endsWith(".class"))
continue;
if (packagePath != null && ! entryName.startsWith(packagePath))
continue;
matcher.init();
ReadStream is = Vfs.openRead(zipFile.getInputStream(entry));
try {
classScanner.init(entryName, is, matcher);
classScanner.scan();
} finally {
is.close();
}
}
} catch (IOException e) {
log.log(Level.FINE, e.toString(), e);
} finally {
jar.closeZipFile(zipFile);
}
}