Karim, Did you try date.minusDays(30).getMillis()? Typically long formats for dates/times are in milliseconds.
On Mon, Jul 29, 2013 at 4:45 PM, Karim Garza <karimga...@gmail.com> wrote: > Hi, > > I am trying to use the MessageFilter to process files that are 30 days or > older. I came up with this code to do the work, but it appears that > the CamelFileLastModified header is a long and I do not know how to use to > compare it with a date. > > public void configure() throws Exception { > DateTime date = new DateTime(); > from("file:{{file.inbox}}?delete=true") > .filter(header("CamelFileLastModified").isLessThan(date.minusDays(30))) > .process(new FileProcessor()); > } > > I would appreciate any help you can provide, > > Karim >