@Override public void dump(boolean compress) throws IOException, java.text.ParseException { for (final Iterator<ArchiveRecord> i = iterator(); i.hasNext();) { ArchiveRecord r = i.next(); System.out.println(r.getHeader().toString()); r.dump(); System.out.println(); } }
@Override public void dump(boolean compress) throws IOException, java.text.ParseException { for (final Iterator<ArchiveRecord> i = iterator(); i.hasNext();) { ArchiveRecord r = i.next(); System.out.println(r.getHeader().toString()); r.dump(); System.out.println(); } }
@Override public void dump(boolean compress) throws IOException, java.text.ParseException { for (final Iterator<ArchiveRecord> i = iterator(); i.hasNext();) { ArchiveRecord r = i.next(); System.out.println(r.getHeader().toString()); r.dump(); System.out.println(); } }
/** * @return True if we have more records to read. * @exception RuntimeException Can throw an IOException wrapped in a * RuntimeException if a problem reading underlying stream (Corrupted * gzip, etc.). */ public boolean hasNext() { // Call close on any extant record. This will scoot us past // any content not yet read. try { cleanupCurrentRecord(); } catch (IOException e) { if (isStrict()) { throw new RuntimeException(e); } if (e instanceof EOFException) { logger.warning("Premature EOF cleaning up " + currentRecord.getHeader().toString() + ": " + e.getMessage()); return false; } // If not strict, try going again. We might be able to skip // over the bad record. logger.log(Level.WARNING,"Trying skip of failed record cleanup of " + currentRecord.getHeader().toString() + ": " + e.getMessage(), e); } return innerHasNext(); }
/** * @return True if we have more records to read. * @exception RuntimeException Can throw an IOException wrapped in a * RuntimeException if a problem reading underlying stream (Corrupted * gzip, etc.). */ public boolean hasNext() { // Call close on any extant record. This will scoot us past // any content not yet read. try { cleanupCurrentRecord(); } catch (IOException e) { if (isStrict()) { throw new RuntimeException(e); } if (e instanceof EOFException) { logger.warning("Premature EOF cleaning up " + currentRecord.getHeader().toString() + ": " + e.getMessage()); return false; } // If not strict, try going again. We might be able to skip // over the bad record. logger.log(Level.WARNING,"Trying skip of failed record cleanup of " + currentRecord.getHeader().toString() + ": " + e.getMessage(), e); } return innerHasNext(); }
/** * @return True if we have more records to read. * @exception RuntimeException Can throw an IOException wrapped in a * RuntimeException if a problem reading underlying stream (Corrupted * gzip, etc.). */ public boolean hasNext() { // Call close on any extant record. This will scoot us past // any content not yet read. try { cleanupCurrentRecord(); } catch (IOException e) { if (isStrict()) { throw new RuntimeException(e); } if (e instanceof EOFException) { logger.warning("Premature EOF cleaning up " + currentRecord.getHeader().toString() + ": " + e.getMessage()); return false; } // If not strict, try going again. We might be able to skip // over the bad record. logger.log(Level.WARNING,"Trying skip of failed record cleanup of " + currentRecord.getHeader().toString() + ": " + e.getMessage(), e); } return innerHasNext(); }
protected void gotoEOR(ArchiveRecord rec) throws IOException { int c; while ((c = getIn().read())==LINE_SEPARATOR); if(c==-1) { return; } long skipped = 1; while (getIn().read()>-1) { skipped++; } // Report on system error the number of unexpected characters // at the end of this record. ArchiveRecordHeader meta = (getCurrentRecord() != null)? rec.getHeader(): null; String message = "Record STARTING at " + ((GZIPMembersInputStream)getIn()).getCurrentMemberStart() + " has " + skipped + " trailing byte(s): " + ((meta != null)? meta.toString(): ""); if (isStrict()) { throw new IOException(message); } logStdErr(Level.WARNING, message); } }
protected void gotoEOR(ArchiveRecord rec) throws IOException { int c; while ((c = getIn().read())==LINE_SEPARATOR); if(c==-1) { return; } long skipped = 1; while (getIn().read()>-1) { skipped++; } // Report on system error the number of unexpected characters // at the end of this record. ArchiveRecordHeader meta = (getCurrentRecord() != null)? rec.getHeader(): null; String message = "Record STARTING at " + ((GZIPMembersInputStream)getIn()).getCurrentMemberStart() + " has " + skipped + " trailing byte(s): " + ((meta != null)? meta.toString(): ""); if (isStrict()) { throw new IOException(message); } logStdErr(Level.WARNING, message); } }
protected void gotoEOR(ArchiveRecord rec) throws IOException { int c; while ((c = getIn().read())==LINE_SEPARATOR); if(c==-1) { return; } long skipped = 1; while (getIn().read()>-1) { skipped++; } // Report on system error the number of unexpected characters // at the end of this record. ArchiveRecordHeader meta = (getCurrentRecord() != null)? rec.getHeader(): null; String message = "Record STARTING at " + ((GZIPMembersInputStream)getIn()).getCurrentMemberStart() + " has " + skipped + " trailing byte(s): " + ((meta != null)? meta.toString(): ""); if (isStrict()) { throw new IOException(message); } logStdErr(Level.WARNING, message); } }