camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Magnus Palmér <magnus.palmer.w...@gmail.com>
Subject Re: Problems with the splitter
Date Thu, 11 Aug 2011 09:56:45 GMT
The body() in your case is a file it seems.
Try to convert it to a String before the split and see if that helps.

convertBodyTo(type) or convertBodyTo(type, charset)

 from(fromUri).
       log("route complete content: ${body}").convertBody(String.class).
       split(body().tokenize("@")).
       log("route line: ${body}").
       end();



2011/8/11 sscharff <stephan.scharff@systemfeld.de>

> It won't split and I don't know why - these are my words for the start
> here.
>
> I created a unit test with Camel and the FakeFtpServer. This ist the
> configure-Method in my RouteBuilder:
>
>  @Override
>  public void configure() throws Exception {
>    from(fromUri).
>        log("route complete content: ${body}").
>        split(body().tokenize("@")).
>        log("route line: ${body}").
>        end();
>  }
>
> and see following log entries:
>
> route1 INFO  route complete content: a@b@c
> route1 INFO  route line: -rwxrwxrwx  1 none     none                   5
> Aug
> 10  2011 file.txt
>
> If I take the char 'o' as my tokenizer, it split the string "-rwxrwxrwx  1
> none     none                   5 Aug 10  2011 file.txt" into parts.
>
> Why takes the splitter not the "real" body?
>
>
> chears*stephan
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Problems-with-the-splitter-tp4688819p4688819.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message