camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-10769 - Added Tika Mutlivalue metadata support. Thanks Tim Allison!
Date Tue, 31 Jan 2017 08:21:10 GMT
Repository: camel
Updated Branches:
  refs/heads/master 69cc6e631 -> 96d784229


CAMEL-10769 - Added Tika Mutlivalue metadata support.  Thanks Tim
Allison!

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/96d78422
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/96d78422
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/96d78422

Branch: refs/heads/master
Commit: 96d784229f0dfcaff98162c8e5c2d00faee08f14
Parents: 69cc6e6
Author: Bob Paulin <bob@bobpaulin.com>
Authored: Mon Jan 30 22:14:12 2017 -0600
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Jan 31 09:21:03 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/component/tika/TikaProducer.java    | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/96d78422/components/camel-tika/src/main/java/org/apache/camel/component/tika/TikaProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-tika/src/main/java/org/apache/camel/component/tika/TikaProducer.java
b/components/camel-tika/src/main/java/org/apache/camel/component/tika/TikaProducer.java
index 309df98..b29f04f 100644
--- a/components/camel-tika/src/main/java/org/apache/camel/component/tika/TikaProducer.java
+++ b/components/camel-tika/src/main/java/org/apache/camel/component/tika/TikaProducer.java
@@ -110,7 +110,12 @@ public class TikaProducer extends DefaultProducer {
     private void convertMetadataToHeaders(Metadata metadata, Exchange exchange) {
         if (metadata != null) {
             for (String metaname : metadata.names()) {
-                exchange.getIn().setHeader(metaname, metadata.get(metaname));
+                String[] values = metadata.getValues(metaname);
+                if (values.length == 1) {
+                    exchange.getIn().setHeader(metaname, values[0]);
+                } else {
+                    exchange.getIn().setHeader(metaname, values);
+                }
             }
         }
     }


Mime
View raw message