camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Hilton <>
Subject Re: De-duplicate route file name?
Date Thu, 16 May 2013 15:04:33 GMT
On 16 May 2013, at 12:23, Peter Hilton <> wrote:
> I’m using Camel to process files, and need to save a copy of each incoming file to
an 'archive' directory. In addition, if another file arrives with the same name as an earlier
file, I must add this to the archive with a different file name and not overwrite an existing
archive file.

I'm currently hoping to do it like this:

	wireTap("file:///archive?fileName=${date:now:yyyy/DDD}/${file:name}", archiveFileNameProcessor)

… where archiveFileNameProcessor is a Processor that modifies the file name (to avoid overwriting
existing files).

How can I parse the URL in my processor to get today’s path, e.g. archive/2013/136? The
processor to check this directory for existing files, in order to calculate the next file
name in the sequence, for duplicate input file names.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message