You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by rbogdanoff <ro...@gmail.com> on 2014/03/06 00:39:59 UTC

Re: FOUND CAUSE! - FTP Move fails - have found cause but don't understands why

I did more debugging and found the cause

If you have streamDownload=true 

Take a look at 
org.apache.camel.component.file.remote.FtpOperations.retrieveFileToStreamInBody(....)

at line 345

            if (endpoint.getConfiguration().isStreamDownload()) {
                InputStream is = client.retrieveFileStream(remoteName); 
                target.setBody(is);
               
exchange.getIn().setHeader(RemoteFileComponent.REMOTE_FILE_INPUT_STREAM,
is);
                result = true;
            } else {
                os = new ByteArrayOutputStream();
                target.setBody(os);
                result = client.retrieveFile(remoteName, os);
            }

If you have streamDownload=true (the default is false) the FTPClient gets
into a different state than what FTPOperations expects.  Then from that
point on, every time there is a call to FTPClient, the FTPClient is "one
call behind" what FTPOperations thinks it is and you get strange behavior.

I am hoping that this is enough info for the people that are knowledgeable
of this code to see the issue.  



--
View this message in context: http://camel.465427.n5.nabble.com/FTP-Move-fails-have-found-cause-but-don-t-understands-why-tp5748358p5748371.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: FOUND CAUSE! - FTP Move fails - have found cause but don't understands why

Posted by rwijngaa <ri...@gmail.com>.
I've experiencedalmost the same problem with this streamDownload option (i
got a lot of exceptions on renaming the file to Archive).
Now i'm using the localWorkDirectory option instead and this seems to work
better!

Regards
Rino



--
View this message in context: http://camel.465427.n5.nabble.com/FTP-Move-fails-have-found-cause-but-don-t-understands-why-tp5748358p5767329.html
Sent from the Camel - Users mailing list archive at Nabble.com.