camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Camel - SFTP rename problems.
Date Thu, 06 Feb 2014 07:58:50 GMT
On Wed, Feb 5, 2014 at 11:00 PM, G√ľnther, Dirk <D.Guenther@cenit.de> wrote:
> Hi Jay,
>
> the move option will always move the file into a subdirectory and will not rename the
file. If you want to rename the file, I think, you can do it with the ssh endpoint.
>

No that is not the intend. You idea would be you can rename and move
to another directory, such as using ../ to go one dir back, etc:
move=../backup/backup-of-${file:onlyname}

There file language (part of simple) has these expressions you can use
http://camel.apache.org/file-language.html



> <route id="rename_file_on_remote_server">
>   <from uri=" sftp://user@remoteserver:22//opt/data/somedir?password=somepassword&localWorkDirectory=/tmp"
/>
> .....
>   <setBody>
>     <constant>mv /opt/data/somedir/${file:name} /opt/data/somedir/${file:name}_processed.txt</constant>
>   </setBody>
>   <to uri="ssh://user:somepassword@remoteserver:22"/>
> </route>
>
>
> Bye,
>
> Dirk
>
> -----Urspr√ľngliche Nachricht-----
> Von: jay [mailto:mylifemyrulesmywish@gmail.com]
> Gesendet: Mittwoch, 5. Februar 2014 17:44
> An: users@camel.apache.org
> Betreff: Camel - SFTP rename problems.
>
>
> Hi - i have a requirement to consume the file from remote server using sftp and rename
the consumed file at same location in remote server.
> suppose my remote file name = "REMOTEFILE.TXT'
> to be renamed to = "${date:now}_PROCESSED.TXT"
>
> I am trying with the below end point - i know which is not correct.
>
> MYENDPOINT =
> sftp://user@remoteserver:22//opt/data/somedir?password=somepassword&localWorkDirectory=/tmp&move=${file:name}_processed.txt
>
> the above creating a directory as __processed.txt in remote server and moving the file
into it.
>
> Can some one help me on the issue where it is going wrong or let me know the best approach
as i am new to camel sftp?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-SFTP-rename-problems-tp5746860.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
> CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711
7825-4000, Internet: www.cenit.de
> Geschaeftsstellen: Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen,
Saarbruecken
> Vorstandsmitglieder: Kurt Bengel, Matthias Schmidt
> Aufsichtsratsmitglieder: Andreas Schmidt (Vorsitzender des Aufsichtsrats), Hubert Leypoldt,
Andreas Karrer
> Bankverbindungen:
> Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE
: DEUTDESS,
> Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code
: COBADEFF600,
> BW-Bank (BLZ 600 501 01) Kto. 2 403 313 IBAN : DE17 6005 0101 0002 4033 13 SWIFT-Code
: SOLADEST
> Registergericht: Amtsgericht Stuttgart
> Handelsregister: HRB Nr. 19117
> Umsatzsteuer: ID-Nr. DE 147 862 777
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Mime
View raw message