Hi Camel does not have any existing option for this.
You can use a java bean to compute the number yourself http://camel.apache.org/file-language.html You can just use the JDK File API to check if the file exists, if it does, then increment the number, and try again. Until you find a "free number". On Mon, Sep 26, 2011 at 11:41 AM, nilsoni <[email protected]> wrote: > Hi, > In File component URI, I have specified "moveFailed=..." option. Now > whenever there is any error, file is moved to error folder. I have a > requirement where files with same name are provided to input endpoint of > file component and if all of them are failing one by one due to any reason, > they should not be overridden in /error folder. Instead, it should be > written in /error folder with some index appended to it. So for example, > > I have provided abc.txt to File input endpoint 5 times, on error, there > should be 5 files in error folder with following name. > abc1.txt > abc2.txt > abc3.txt > abc4.txt > abc5.txt > > Again, this should be done by camel and not by me by writing some index > number in header as i may not be knowing what was the last index used > (application may be shutdown in between multiple runs of flow mentioned > above). Is there any uri option in camel which does this automatically? > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Appending-index-number-in-file-name-written-in-error-folder-by-File-component-tp4840768p4840768.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/
