ArchiveInputStream ais;
try {
ArchiveStreamFactory factory = new ArchiveStreamFactory();
ais = factory.createArchiveInputStream(stream);
} catch (ArchiveException e) {
throw new MorphlineRuntimeException("Unable to unpack document stream", e);
}
try {
ArchiveEntry entry = ais.getNextEntry();
while (entry != null) {
if (!entry.isDirectory()) {
if (!parseEntry(ais, entry, extractor, record)) {
return false;
}
}
entry = ais.getNextEntry();
}
} catch (IOException e) {
throw new MorphlineRuntimeException(e);
} finally {
Closeables.closeQuietly(ais);
}
return true;
}