You may have to close the buffered reader you use in the processor. It may be the OS is locking the file due this reader has not been closed. And therefore Camel cannot delete the file.
On Mon, Jul 25, 2011 at 9:22 PM, cwhistler <[email protected]> wrote: > I have the following java route: > > from("c:/temp/files?delete=true&filter=#errorFileFilter") > .processRef("processAcceptedFiles") > .to("c:/temp/output") > ; > > The errorFileFilter reference simply returns false if the file name contains > some error file markers. > > The processor simply adds up the lines in the file and adds a header and > trailer record to it: > BufferedReader inputReader = exchange.getIn().getBody(BufferedReader.class); > long idx = 0; > try > { > while (null != (inputReader.readLine())) > { > idx++; > } > } > catch(Exception e) > { > e.printStackTrace(); > } > exchange.getIn().setBody(getHdr() + "\n" + > exchange.getIn().getBody(String.class) + getEnd(idx) + "\n"); > > When the route ends the input file is not deleted. it simply gets > reprocessed over and over. > > So can I do this and still have the input file deleted? > > I am using camel 2.7.2 > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/file-delete-doesn-t-work-when-using-filter-tp4632063p4632063.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
