if (record.httpHeader != null) {
if (record.httpHeader.isValid()) {
record.payload.setPayloadHeaderWrapped(record.httpHeader);
} else {
record.diagnostics.addError(
new Diagnosis(DiagnosisType.ERROR,
"http header",
"Unable to parse http header!"));
}
}
}
}
}
// Preliminary compliance status, will be updated when the
// payload/record is closed.
if (record.diagnostics.hasErrors() || record.diagnostics.hasWarnings()) {
record.bIsCompliant = false;
} else {
record.bIsCompliant = true;
}
reader.bIsCompliant &= record.bIsCompliant;
} else {
// In case no record is found the errors/warnings in the record
// object are transfered to the Reader.
reader.diagnostics.addAll(record.diagnostics);
if (record.diagnostics.hasErrors() || record.diagnostics.hasWarnings()) {
reader.errors += record.diagnostics.getErrors().size();
reader.warnings += record.diagnostics.getWarnings().size();
reader.bIsCompliant = false;
}
// Require one or more records to be present.
if (reader.records == 0) {
reader.diagnostics.addError(new Diagnosis(DiagnosisType.ERROR_EXPECTED, "WARC file", "One or more records"));
++reader.errors;
reader.bIsCompliant = false;
}
// EOF
record = null;