On Wed, Mar 16, 2011 at 2:42 PM, adi milis <[email protected]> wrote: > 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.
Jonathan updated chapter 2 to mention regexp and show how to filter only XML files. Will be in the updated book, when Manning does a 2nd print. > > > > On Wed, Mar 16, 2011 at 7:39 PM, Claus Ibsen <[email protected]> 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 <[email protected]> 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: [email protected] >> Web: http://fusesource.com >> Twitter: davsclaus >> Blog: http://davsclaus.blogspot.com/ >> Author of Camel in Action: http://www.manning.com/ibsen/ >> > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
