Hello, I need to create a file with lots of data  depending on a user request
and transfer that temp file to a remote ftp.   I have everything running
without errors and the remote file is created but the content of the created
remote file is still 0 bytes while the temp file has lots of bytes. 
I don't understand what i'm doing wrong.

Here's the essence of my code:



public class MYRoute extends AbstractRoute {
        
        public void configure() throws Exception 
        {
                super.configure();


         File temp = File.createTempFile("mytempfile.json"); 

         String uriOut = "sftp://"+ System.getenv("my_sftp_host")+
"/INCOMMING?"
                        + "eagerDeleteTargetFile=false&"
                        + "exchangePattern=OutOnly&"
                        + "allowNullBody=true&"
                        + "fileName=my_gen_inf.json&"
                        + "password="+ System.getenv("my_sftp_password")+ "&"
                        + "username="+ System.getenv("my_sftp_username")+ "&"
                        + "timeout=60000&"
                        + "useList=false"; 


        rest("some url")
                .get("/generic").produces(MIME_MEDIA_TYPE_JSON)
                .route()
                .routeId("MY_generic_interface")
                .process(new fillTempFileWithaLotOfData(temp.toURI()))
                .from(temp.toURI().toString())
                .to(uriOut)
                .setBody(constant("{ 'result': 'OK'}"));
  } 


Any help is appreciated.

Jan van de Klok



--
View this message in context: 
http://camel.465427.n5.nabble.com/Cannot-write-content-of-temp-file-to-remote-ftp-tp5780480.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to