camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adi milis <milis....@gmail.com>
Subject Re: moving file with camel
Date Wed, 16 Mar 2011 13:42:54 GMT
Thanks .. It works now

btw, I got the code from the first chapter of your book in amazon,
in Easy Configuration section, the code doesnt even mention about regex.



On Wed, Mar 16, 2011 at 7:39 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:

> Hi
>
> The include option is using Java Reg Exp so you have to configure that
> with a valid regexp.
>
> So to only include PNG files you do like this: .*png$
> This is a reg exp to match a string ending with png.
>
>
>
> On Wed, Mar 16, 2011 at 1:30 PM, adi milis <milis.adi@gmail.com> wrote:
> > Hi,
> >
> > I want to create simple routing in camel, to filter and move file
> >
> > the case, I have one input folder, depends on the extention, it will be
> > moved to other folder
> >
> > my routings are
> > try {
> >            context.addRoutes(new RouteBuilder() {
> >                public void configure() {
> >
> >  from("file:data/inbox?noop=false&include=*.png").to("file:data/png");
> >                }
> >            });
> >        } catch (Exception e) {
> >            System.out.println(e.getMessage());
> > }
> >
> > however, i got the following errors ..
> >
> > WARNING: Consumer Consumer[file://data/inbox?include=*.png&noop=false]
> could
> > not poll endpoint: file://data/inbox?include=*.png&noop=false caused by:
> > Dangling meta character '*' near index 0
> > *.png
> > ^
> > java.util.regex.PatternSyntaxException: Dangling meta character '*' near
> > index 0
> > *.png
> > ^
> >        at java.util.regex.Pattern.error(Pattern.java:1713)
> >
> > any idea what i'm missing here ?
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>

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