On Wed, Feb 10, 2010 at 5:17 PM, mcrive <mcr...@optasportsdata.com> 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: > http://old.nabble.com/GenericFileProducer-behavior-when-temp-file-is-used-tp27533791p27533791.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus