On Fri, Jul 15, 2011 at 11:50 AM, divanmostert <divan.most...@c24.biz> wrote:
> Thanks all - I managed to get it working with this suggestion. I had to
> re-use the same Endpoint and ChoiceDefinition and just added
> .when(header("CamelFileName").isEqualTo("aFileName.txt").to(...) for each
> input.
>

If you have a convention you can use the recipient list

 from("file:directory")
   .recipientList(simple("direct:${file:onlyname.noext}"));

http://camel.apache.org/file-language.html
http://camel.apache.org/simple.html


>
> Marco Westermann wrote:
>>
>> from("file:directory")
>>      .choice()
>>          .when(header("filename").isEqualTo("a.txt"))
>>              .to("direct:a")
>>         .when(header("filename").isEqualTo("b.txt"))
>>              .to("direct:b")
>>        .otherwise()
>>              .to("direct:unknown");
>>
>>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Loading-multiple-files-from-the-same-directory-tp4585994p4590059.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to