You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Arnout Engelen (JIRA)" <ji...@apache.org> on 2012/12/04 23:20:58 UTC

[jira] [Updated] (CAMEL-5847) Convert files or inputstreams

     [ https://issues.apache.org/jira/browse/CAMEL-5847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arnout Engelen updated CAMEL-5847:
----------------------------------

    Attachment: mongodbconverters.diff
    
> Convert files or inputstreams
> -----------------------------
>
>                 Key: CAMEL-5847
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5847
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-mongodb
>            Reporter: Arnout Engelen
>         Attachments: mongodbconverters.diff
>
>
> Inserting files into MongoDB doesn't work like this:
> {code}
> from("file:///tmp/test/apachecon?runLoggingLevel=TRACE")
>     .to("mongodb:connectionBean?database=x&collection=y&operation=insert");
> {code}
> It requires an explicit {{.convertBodyTo(String.class)}}. 
> The attached patch adds {{Converter}}s for File and InputStream object, detecting and supporting both {{JSON}} and {{BSON}} files/streams.
> The {{new String(input, "utf-8"))}} fragment seems a bit dodgy, but I don't really see a better way.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira