public Iterator<Vfs.File> iterator() {
return new AbstractIterator<Vfs.File>() {
{
try { jarInputStream = new JarInputStream(url.openConnection().getInputStream()); }
catch (Exception e) { throw new ReflectionsException("Could not open url connection", e); }
}
protected Vfs.File computeNext() {
while (true) {
try {
ZipEntry entry = jarInputStream.getNextJarEntry();
if (entry == null) {
return endOfData();
}
long size = entry.getSize();
if (size < 0) size = 0xffffffffl + size; //JDK-6916399
nextCursor += size;
if (!entry.isDirectory()) {
return new JarInputFile(entry, JarInputDir.this, cursor, nextCursor);
}
} catch (IOException e) {
throw new ReflectionsException("could not get next zip entry", e);
}
}
}
};
}