27 if (meta->get_file_path() == file_path) {
43 }
else if (meta->get_group_id() ==
m_group_id) {
74 std::vector<std::string> files;
76 files.push_back(file->get_file_path().string());
86 nlohmann::json j = nlohmann::json::parse(str);
88 TLOG() <<
"debug : Loading metadata from string " << str;
90 if (j.contains(
"transfer_id")) {
93 if (j.contains(
"source_id")) {
96 if (j.contains(
"source_ip")) {
99 if (j.contains(
"protocol")) {
102 if (j.contains(
"protocol_options")) {
105 if (j.contains(
"files")) {
106 auto files = j[
"files"].get<std::vector<std::filesystem::path>>();
108 for (
const auto& file : files) {
117 std::ofstream metadata_file;
122 metadata_file.close();
128 std::ifstream metadata_file;
130 metadata_file.open(src.string());
131 }
catch (
const std::exception& e) {
136 std::stringstream buffer;
137 buffer << metadata_file.rdbuf();
141 metadata_file.close();
152 str +=
"*file " + file->get_file_name() +
"\n";
155 str +=
"*expectedfile " + file +
"\n";
void fatal(const Issue &issue)
void error(const Issue &issue)
static std::optional< e_protocol_type > string_to_protocols(std::string s)
static std::string protocols_to_string(e_protocol_type e)