On Fri, Nov 16, 2012 at 7:44 PM, Vishal Changrani <[email protected]> wrote: > Hi, > I want to configure an FTP Consumer to consume multiple files such as > abcd_20121116.zip, xyz_20121116.zip etc. Basically <filename > pattern>_<today's date>.zip. > > I tried giving filename=(abcd|xyz)_${date:now:yyyymmdd}.zip as part of the > URI but this doesn't consumes abcd_20121116.zip or xyz_20121116.zip. I think > the FTP consumer expects a file which starts with (abcd.. > And doesn't really look for the regex abcd or xyz. > I changed the URL to contain an include=(abcd|xyz)... rather than a filename > but then it doesn't understand the ${date:now:yyyymmdd} file language. > > Is there any way to confiure mutiple file consumption with the file langugage > or specify a regex with today's date? > Thanks in advance, > Vishal >
The fileName can be configured using the simple language http://camel.apache.org/simple It does not allow you to mix regular expression and that date function from simple language. Though you may use the OR operator. fileName=abcd_${date:now:yyyymmdd}.zip || xyz_${date:now:yyyymmdd}.zip An alternative is to use a java bean, and refer to that bean fileName=${bean:myBean?method=callMe} > > > -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
