|
|
@ -1,15 +1,15 @@ |
|
|
|
// Copyright (C) 2018 Andreas Romeyke (art1@andreas-romeyke.de), 2018.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
#include "bag.hpp"
|
|
|
@ -108,7 +108,7 @@ bool Bag::store( string basedir ) { |
|
|
|
fs::file_status s = fs::status( p ); |
|
|
|
if (fs::is_directory( s)) { |
|
|
|
log << "directory '" << basedir << "' already exists" << endl; |
|
|
|
return false; |
|
|
|
// return false;
|
|
|
|
} |
|
|
|
fs::create_directory(p); |
|
|
|
|
|
|
@ -299,6 +299,14 @@ bool Bag::validate() { |
|
|
|
return is_valid; |
|
|
|
} |
|
|
|
|
|
|
|
void Bag::create_new( Payload * payload_p ) { |
|
|
|
this->payload_p = payload_p; |
|
|
|
/* add metadata and stuff */ |
|
|
|
this->bagit_version_major = 0; |
|
|
|
this->bagit_version_minor = 97; |
|
|
|
this->tag_file_character_encoding = "UTF-8"; |
|
|
|
} |
|
|
|
|
|
|
|
void Bag::get_logstream( stringstream & log ) { |
|
|
|
log << this->log.rdbuf(); |
|
|
|
} |
|
|
|