private WARCRecord readNext() throws IOException {
            WARCRecord nextRecord = null;
            if (warcReader != null) {
                try {
                    nextRecord = (WARCRecord) warcRecordIterator.next();
                } catch (Exception e) {
                    nextRecord = null;
                }
                if (nextRecord == null) { // end of file reached
                    warcReader.close();
                    if (!filesIt.hasNext()) {
                        IOUtils.closeQuietly(filesStream);
                        return null; // no more file and lines available
                    }
                    // read next file available
                    Path filePath = null;
                    try {
                        filePath = filesIt.next();
                        warcReader = openFile(filePath);
                        warcRecordIterator = warcReader.iterator();
                        nextRecord = (WARCRecord) warcReader.get();
                    } catch (IOException e) {
                        String f = filePath == null ? null : filePath.toString();
                        throw new IllegalStateException("Failed to open file: " + f, e);
                    }
                }
            }
            Object warcType = nextRecord.getHeader().getHeaderValue("WARC-Type");
            if (nextRecord != null && warcType.equals("warcinfo")) {
                // skip the header of the warc file
                if (hasNext()) {
                    return readNext();
                }
            }
            return nextRecord;
        }
Returns Iterator of WarcReader

@return
@throws IOException
ache/src/main/java/achecrawler/target/repository/WarcTargetRepository.java