public void testWarcReading() throws Exception { ArchiveReader archiveReader = ArchiveReaderFactory.get(TestInfo.WARC_FILE1); Iterator<? extends ArchiveRecord> it = archiveReader.iterator(); assertTrue("Warc should contains records", it.hasNext()); while (it.hasNext()) { ArchiveRecord next = it.next(); System.out.println("mimetype:" + next.getHeader().getMimetype()); System.out.println("url:" + next.getHeader().getUrl()); } }
protected ArchiveReader wrapStream(String url, InputStream arcStream) throws IOException { ArchiveReader ret = null; logger.debug3("Getting an ArchiveReader"); ret = ArchiveReaderFactory.get(url, arcStream, true); return (ret); }