Hi

What version of Camel do you use?

And frankly Camel ought to be able to write a String body to a file,
so that is a bit surprising. Maybe you can post your stacktrace for us
to look at?

On Fri, Jun 8, 2018 at 10:14 AM, Ivana Cace <[email protected]> wrote:
> Hi,
>
>
> I'm trying to sort a csv file, but when I try to write the file i get a 
> InvalidPayloadException due to "Error during type conversion from type: 
> java.lang.String to the required type: java.io.InputStream".
>
>
> Here is the route:
>
>
> from("file:path?filterFile=${file:size} < 6000")
>          .sort(body().tokenize("\n"), new ColumnSortComperator(1, ','))
>          .to("file:path/sorted?fileExist=Append")
>          .end();
>
> As far as i understand, the tokenizer outputs String, but to write the line 
> to the file i need a Inputstream.
> How do i make a Inputstream from the sorted lines?
> Is the only way to implement a processor that stuffs the lines + line endings 
> into the exchange body?
>
>
> thanks in advance,
>
>
> Ivana
>
>
> ***************************************** De informatie verzonden in deze 
> e-mail (inclusief bijlagen) kan vertrouwelijk van aard zijn en is uitsluitend 
> bestemd voor de geadresseerde(n). Indien deze e-mail niet voor u bestemd is, 
> verzoeken wij u vriendelijk het bericht te retourneren en vervolgens te 
> vernietigen. Yarden doet er alles aan om ervoor te zorgen dat verzonden 
> e-mailberichten vrij zijn van virussen, maar kan dit niet garanderen. Yarden 
> Holding B.V., statutair gevestigd te Almere, Handelsregisternummer 34155452 
> Yarden Uitvaartfaciliteiten B.V., statutair gevestigd te Almere, 
> Handelsregisternummer 30104432 Yarden Uitvaartzorg B.V., statutair gevestigd 
> te Almere, Handelsregisternummer 04050164 Yarden Uitvaartverzekeringen N.V., 
> statutair gevestigd te Almere, Handelsregisternummer 33244450 
> *****************************************



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to