adamdebreceni commented on a change in pull request #1153:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1153#discussion_r683343728
##########
File path: extensions/libarchive/CompressContent.cpp
##########
@@ -191,14 +194,20 @@ void CompressContent::processFlowFile(const
std::shared_ptr<core::FlowFile>& flo
if (compressMode_ == CompressionMode::Compress) {
session->putAttribute(result, core::SpecialFlowAttribute::MIME_TYPE,
mimeType);
if (updateFileName_) {
+ if (encapsulateInTar_) {
+ fileName = fileName + TAR_EXT;
+ }
fileName = fileName + fileExtension;
session->putAttribute(result, core::SpecialFlowAttribute::FILENAME,
fileName);
}
} else {
session->removeAttribute(result, core::SpecialFlowAttribute::MIME_TYPE);
if (updateFileName_) {
- if (fileName.size() >= fileExtension.size() &&
fileName.compare(fileName.size() - fileExtension.size(), fileExtension.size(),
fileExtension) == 0) {
+ if (utils::StringUtils::endsWith(fileName, fileExtension)) {
fileName = fileName.substr(0, fileName.size() -
fileExtension.size());
+ if (encapsulateInTar_ && utils::StringUtils::endsWith(fileName,
TAR_EXT)) {
Review comment:
using the `encapsulateInTar_` during decompression seems strange,
shouldn't we infer the need for "de-tar-ing" only from the extension?
--
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]