/** * Check signature. Bytestreams have no signatures, but since any * byte stream is considered a valid Bytestream, return immediately * doing nothing. The RepInfo._consistent flag will remain true. */ @Override public void checkSignatures (File file, InputStream stream, RepInfo info) { info.setFormat (this._format[0]); info.setMimeType (this._mimeType[0]); info.setModule (this); info.setSigMatch(this._name); } }
@Override public void checkSignatures (File file, InputStream stream, RepInfo info) throws IOException { info.setFormat (_format[0]); info.setMimeType (_mimeType[0]); info.setModule (this); ByteCountingPushBackInputStream pbin = new ByteCountingPushBackInputStream(stream, GzipReader.DEFAULT_INPUT_BUFFER_SIZE); // First try warc uncompressed boolean checkIsWarc = WarcReaderFactory.isWarcFile(pbin); if (checkIsWarc) { info.setSigMatch(_name); return; } // Then try warc compressed boolean checkIsGzip = GzipReader.isGzipped(pbin); if (checkIsGzip) { info.setSigMatch(_name); return; } // Not a warc or a gzip info.setWellFormed (false); }
info.setSigMatch(_name); return; // sig matches info.setSigMatch (_name);
if (sigstate[i] == st.length) { info.setSigMatch(_name); return;
info.setSigMatch(_name);
@Override public void checkSignatures (File file, InputStream stream, RepInfo info) throws IOException { info.setFormat (_format[0]); info.setMimeType (_mimeType[0]); info.setModule (this); boolean checkIsGzip = GzipReader.isGzipped(new ByteCountingPushBackInputStream(stream, GzipReader.DEFAULT_INPUT_BUFFER_SIZE)); if (checkIsGzip) { info.setSigMatch(_name); } else { info.setWellFormed (false); } }
info.setSigMatch(infc.getSigMatch());
info.setSigMatch(_name);
info.setFormat (_format[0]); info.setMimeType (_mimeType[0]); info.setSigMatch(_name);
info.setSigMatch(_name);
protected boolean parseHeader(RepInfo info) throws IOException { PdfHeader header = PdfHeader.parseHeader(_parser); if (header == null) { info.setWellFormed(false); info.setMessage(new ErrorMessage(MessageConstants.ERR_PDF_HEADER_MISSING, 0L)); // PDF-HUL-137 return false; } if (!header.isVersionValid()) { info.setValid(false); info.setMessage(new ErrorMessage(MessageConstants.ERR_PDF_MINOR_INVALID, 0L)); // PDF-HUL-148 } _version = header.getVersionString(); _pdfACompliant = header.isPdfACompliant(); info.setSigMatch(_name); return true; }
info.setFormat(_format[0]); info.setMimeType(_mimeType[0]); info.setSigMatch(_name);
info.setSigMatch(_name); _reportedSigMatch = true;
@Override public int parse(InputStream stream, RepInfo info, int parseIndex) throws IOException { GzipReader reader = new GzipReader(new InputStreamNoSkip(stream), 8192); try { info.setFormat(_format[0]); info.setVersion("4.3"); // Is it really version 4.3? info.setMimeType(_mimeType[0]); info.setModule(this); parseRecords(reader); info.setValid(reader.isCompliant()); info.setWellFormed(reader.isCompliant()); reportResults(reader, info); if (reader.isCompliant()) { info.setSigMatch(_name); } } catch (Exception e) { info.setMessage(new ErrorMessage(e.getMessage())); info.setValid(false); info.setWellFormed(false); } finally { if(reader != null) { reader.close(); reader = null; } } return 0; }
info.setSigMatch(_name); } else {
info.setFormat (_format[0]); info.setMimeType (_mimeType[0]); info.setSigMatch(_name);
info.setSigMatch(_name); _reportedSigMatch = true;
info.setSigMatch(_name);
@Override public int parse(InputStream stream, RepInfo info, int parseIndex) throws IOException { WarcReader reader = WarcReaderFactory.getReader(new InputStreamNoSkip(stream), 8192); try { info.setFormat(_format[0]); info.setMimeType(_mimeType[0]); info.setModule(this); setReaderOptions(reader); parseRecords(reader); info.setValid(reader.isCompliant()); info.setWellFormed(reader.isCompliant()); reportResults(reader, info); if (reader.isCompliant()) { info.setSigMatch(_name); } } catch (JhoveException e) { info.setMessage(new ErrorMessage(e.getMessage())); info.setValid(false); info.setWellFormed(false); } finally { if(reader != null) { reader.close(); reader = null; } } return 0; }
info.setSigMatch(_name); _reportedSigMatch = true;