use of org.opensolaris.opengrok.analysis.IteratorReader in project OpenGrok by OpenGrok.
the class TarAnalyzer method analyze.
@Override
public void analyze(Document doc, StreamSource src, Writer xrefOut) throws IOException {
ArrayList<String> names = new ArrayList<>();
try (TarInputStream zis = new TarInputStream(src.getStream())) {
TarEntry entry;
while ((entry = zis.getNextEntry()) != null) {
String name = entry.getName();
names.add(name);
if (xrefOut != null) {
Util.htmlize(name, xrefOut);
xrefOut.append("<br/>");
}
}
}
doc.add(new TextField("full", new IteratorReader(names)));
}
use of org.opensolaris.opengrok.analysis.IteratorReader in project OpenGrok by OpenGrok.
the class ZipAnalyzer method analyze.
@Override
public void analyze(Document doc, StreamSource src, Writer xrefOut) throws IOException {
ArrayList<String> names = new ArrayList<>();
try (ZipInputStream zis = new ZipInputStream(src.getStream())) {
ZipEntry entry;
while ((entry = zis.getNextEntry()) != null) {
String name = entry.getName();
names.add(name);
if (xrefOut != null) {
Util.htmlize(name, xrefOut);
xrefOut.append("<br/>");
}
}
}
doc.add(new TextField("full", new IteratorReader(names)));
}
Aggregations