You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/11/03 18:39:38 UTC
[camel] branch master updated: [CAMEL-15797] Update
isIncludeFolders check in AWS2S3Consumer to cover folders with charset
(#4558)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 66deba8 [CAMEL-15797] Update isIncludeFolders check in AWS2S3Consumer to cover folders with charset (#4558)
66deba8 is described below
commit 66deba81dd53a4034929cb123fad3a5f07c1489c
Author: Filipe Portes <om...@gmail.com>
AuthorDate: Tue Nov 3 19:36:16 2020 +0100
[CAMEL-15797] Update isIncludeFolders check in AWS2S3Consumer to cover folders with charset (#4558)
* Update isIncludeFolders check in AWS2S3Consumer
covers cases where the s3Object contentType is coming from s3 as "application/x-directory; charset=UTF-8"
* includes Optional import
---
.../main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java b/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java
index 2bd8d6d..f5148e9 100644
--- a/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java
+++ b/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Consumer.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
+import java.util.Optional;
import java.util.Queue;
import org.apache.camel.AsyncCallback;
@@ -218,7 +219,8 @@ public class AWS2S3Consumer extends ScheduledBatchPollingConsumer {
return true;
} else {
// Config says to ignore folders/directories
- return !"application/x-directory".equalsIgnoreCase(s3Object.response().contentType());
+ return !Optional.of(((GetObjectResponse) s3Object.response()).contentType()).orElse("")
+ .toLowerCase().startsWith("application/x-directory");
}
}