You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "yury.dorofeev" <u....@gmail.com> on 2016/02/26 09:20:17 UTC

How to rename file on FTP, example

Hi,
I'm looking for example of how to rename the file on FTP. My scenario: 

1. marshal message to the HUGE XML file
2. upload file to FTP with temp name (myFile.tmp)
3. when the upload is complete rename myFile.tmp to myFile.xml

There is good docs on http://camel.apache.org/file2.html but it does not
help

I use spring xml configuration: 
<camel:from uri="seda:myService"></camel:from>
     <camel:convertBodyTo type="myObjectOutput"/>
          <camel:marshal>
                <camel:jaxb
                        contextPath="myPath"/>
          </camel:marshal>
          <camel:to
uri="ftp://username:password@127.0.0.1:21/folder?tempFileName=myFile.tmp&amp;move=myFile.xml"></camel:to>
</camel:route>
    </camel:camelContext>

Please help! 
It would be nice to have a real example in documentation
Thank you! 



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-rename-file-on-FTP-example-tp5778311.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: How to rename file on FTP, example

Posted by "yury.dorofeev" <u....@gmail.com>.
Thank you Claus!



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-rename-file-on-FTP-example-tp5778311p5778322.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: How to rename file on FTP, example

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Next time use the @user mailing list / user forum. This is the wrong place.

Your uri should not use move, but fileName as the intended file name.

uri="ftp://username:password@127.0.0.1:21/folder?tempFileName=myFile.tmp&amp;fileName=myFile.xml">

On Fri, Feb 26, 2016 at 9:20 AM, yury.dorofeev <u....@gmail.com> wrote:
> Hi,
> I'm looking for example of how to rename the file on FTP. My scenario:
>
> 1. marshal message to the HUGE XML file
> 2. upload file to FTP with temp name (myFile.tmp)
> 3. when the upload is complete rename myFile.tmp to myFile.xml
>
> There is good docs on http://camel.apache.org/file2.html but it does not
> help
>
> I use spring xml configuration:
> <camel:from uri="seda:myService"></camel:from>
>      <camel:convertBodyTo type="myObjectOutput"/>
>           <camel:marshal>
>                 <camel:jaxb
>                         contextPath="myPath"/>
>           </camel:marshal>
>           <camel:to
> uri="ftp://username:password@127.0.0.1:21/folder?tempFileName=myFile.tmp&amp;move=myFile.xml"></camel:to>
> </camel:route>
>     </camel:camelContext>
>
> Please help!
> It would be nice to have a real example in documentation
> Thank you!
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-rename-file-on-FTP-example-tp5778311.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2