camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlj <>
Subject FTP temp file not being created correctly on Windows (Camel 2.7.2) ?
Date Fri, 15 Jul 2011 17:37:31 GMT

I have the following route which sends a file from my local file system via
FTP to a folder that does not yet exist
on the remote server.

ctx.addRoutes( new RouteBuilder() {
	public void configure() throws Exception 
		from( "file://target/in?recursive=true&delay=5000")
} );

The route uses the tempFileName URI option to create a temp file which is
then renamed after the transfer is complete.

On Linux the route works correctly, but on Windows the .part file is not
being created on the FTP server in the correct sub-folder relative to the
FTP directory name, but instead is created in the root FTP directory. Camel
then attempts to the rename the file, but if the actual destination folder
does not exist, a "Cannot rename File from :...."
GenericFileOperationFailedException is thrown.

I think the problem is in the createTempFileName() on the
GenericFileProducer which calculates the temp file
destination by looking for the last file separator on the fileName. The File
separator being defined as '/' on the 
producer sub-class, but the original file name still contains the windows
file separator. This seems to mess up the calculation of the the tempName.

Not sure if I'm using the DSL correctly, or I can tweak my route to get the
desired behaviour?



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

View raw message