Browse Source

- enabled output if validation error

master
Andreas Romeyke 1 year ago
parent
commit
0564198810
  1. 16
      src/lib/bag.cpp

16
src/lib/bag.cpp

@ -213,12 +213,16 @@ bool Bag::validate() {
}
if (nullptr == this->payloadmanifest_p) {
is_valid = false;
this->log << "Bagit payload manifest missed!" << endl;
} else {
// checksums check
this->log << "Bagit payload manifest" << endl;
bool ret = this->payloadmanifest_p->validate();
if (!ret) {
is_valid = false;
stringstream log;
this->payloadmanifest_p->get_logstream( log );
this->log << log.str();
}
if (nullptr != this->payload_p) {
// check if payload checksums missed for payload files
@ -259,18 +263,25 @@ bool Bag::validate() {
}
// next elements are optional
if (nullptr == this->tagmanifest_p) {
this->log << "Bagit tag manifest is missed" << endl;
} else {
this->log << "Bagit tag manifest" << endl;
bool ret = this->tagmanifest_p->validate();
if (!ret) {
is_valid = false;
stringstream log;
this->tagmanifest_p->get_logstream( log );
this->log << log.str();
is_valid = false;
}
}
if (nullptr == this->bagmetadata_p) {
} else {
bool ret = this->bagmetadata_p->validate();
if (!ret) {
is_valid = false;
stringstream log;
this->bagmetadata_p->get_logstream( log );
this->log << log.str();
is_valid = false;
}
if (this->bagmetadata_p->has_PayloadOxum()) {
// check oxum of payload
@ -288,7 +299,6 @@ bool Bag::validate() {
is_valid = false;
}
}
}
}
/*

Loading…
Cancel
Save