fgerlits commented on code in PR #1476:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1476#discussion_r1062441225
##########
extensions/standard-processors/processors/GetFile.cpp:
##########
@@ -164,12 +158,14 @@ void GetFile::getSingleFile(core::ProcessSession&
session, const std::filesystem
logger_->log_info("GetFile process %s", file_path.string());
auto flow_file = session.create();
gsl_Expects(flow_file);
+
flow_file->setAttribute(core::SpecialFlowAttribute::FILENAME,
file_path.filename().string());
- flow_file->setAttribute(core::SpecialFlowAttribute::PATH,
(file_path.parent_path() / "").string());
- flow_file->addAttribute(core::SpecialFlowAttribute::ABSOLUTE_PATH,
file_path.string());
+ flow_file->setAttribute(core::SpecialFlowAttribute::ABSOLUTE_PATH,
std::filesystem::absolute(file_path.parent_path() / "").string());
+ auto relative_path = std::filesystem::relative(file_path.parent_path(),
request_.inputDirectory);
+ flow_file->setAttribute(core::SpecialFlowAttribute::PATH, (relative_path /
"").string());
try {
- session.write(flow_file, utils::FileReaderCallback{file_path});
+ session.write(flow_file, utils::FileReaderCallback{file_path.string()});
Review Comment:
this `.string()` and the one at line 256 are no longer needed, since both
functions expect a `filesystem::path` now that your PR #1424 has been merged
(same in `GetFileTests.cpp`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]