camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: GenericFileProducer behavior when temp file is used
Date Wed, 10 Feb 2010 20:41:08 GMT
On Wed, Feb 10, 2010 at 5:17 PM, mcrive <> wrote:
> Hi,
> looking into the source code of GenericFileProducer I found out that when
> using the tempFileName option following happens:
> - if final file exists it gets deleted
> - temp file gets written
> - temp file gets renamed into final file
> Deleting the final file before uploading the new file seems unsafe.
> Suppose there is a network error (FTP) and the upload fails, then the final
> file would be lost.
> Uploading big files will result on missing final file for a while.
> Would it be possible to change this behavior or add an option to change it?
> I would do following:
> - upload temp file
> - delete final file
> - rename temp file into final file

Not better IMHO as its better to fail fast. Deleting the final file is
a fail safe check. In general the final file should not already exists
on the FTP server.

The current behavior is the mot correct IMHO

> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Apache Camel Committer

Author of Camel in Action:
Open Source Integration:

View raw message