You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by florent andré <fl...@4sengines.com> on 2010/11/26 13:16:22 UTC

Create an empty .done file when file upload on a ftp

Hi all,
newbie here !

My usecase is :
- upload files on an ftp (file1.txt, file2.txt,...)
- for each uploaded file, create an *empty*  {fileName}.done file on the
ftp server.

I try this configuration add some variants, but nothing good

from("file:test-files?noop=true").
    to("ftp://goodconfig")
    .from("file:test-files?fileName=${file:onlyname}.done&noop=true")
    .to("ftp://goodconfig");

How I can create an empty file with camel and transfert it to the ftp ?
In don't want to use ftp commands if possible.

Cheers.

Re: Create an empty .done file when file upload on a ftp

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

I found the old ticket and created a new ticket for the producer side also
https://issues.apache.org/activemq/browse/CAMEL-3369

On Fri, Nov 26, 2010 at 1:47 PM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> We do have a ticket in JIRA to supports this out of the box as a
> configuration on the fil/ftp endpoint.
>
> What you can do is to send an empty message to the ftp endpoint after
> the first file has been uploaded.
>
> from(file)
>    .to(ftp)
>    .setBody(constant(""))   // set empty body to use for the .done file
>    .to(ftp?fileName=${file:onlyname}.done);
>
>
>
>
>
> On Fri, Nov 26, 2010 at 1:16 PM, florent andré
> <fl...@4sengines.com> wrote:
>> Hi all,
>> newbie here !
>>
>> My usecase is :
>> - upload files on an ftp (file1.txt, file2.txt,...)
>> - for each uploaded file, create an *empty*  {fileName}.done file on the
>> ftp server.
>>
>> I try this configuration add some variants, but nothing good
>>
>> from("file:test-files?noop=true").
>>    to("ftp://goodconfig")
>>    .from("file:test-files?fileName=${file:onlyname}.done&noop=true")
>>    .to("ftp://goodconfig");
>>
>> How I can create an empty file with camel and transfert it to the ftp ?
>> In don't want to use ftp commands if possible.
>>
>> Cheers.
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Create an empty .done file when file upload on a ftp

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

We do have a ticket in JIRA to supports this out of the box as a
configuration on the fil/ftp endpoint.

What you can do is to send an empty message to the ftp endpoint after
the first file has been uploaded.

from(file)
    .to(ftp)
    .setBody(constant(""))   // set empty body to use for the .done file
    .to(ftp?fileName=${file:onlyname}.done);





On Fri, Nov 26, 2010 at 1:16 PM, florent andré
<fl...@4sengines.com> wrote:
> Hi all,
> newbie here !
>
> My usecase is :
> - upload files on an ftp (file1.txt, file2.txt,...)
> - for each uploaded file, create an *empty*  {fileName}.done file on the
> ftp server.
>
> I try this configuration add some variants, but nothing good
>
> from("file:test-files?noop=true").
>    to("ftp://goodconfig")
>    .from("file:test-files?fileName=${file:onlyname}.done&noop=true")
>    .to("ftp://goodconfig");
>
> How I can create an empty file with camel and transfert it to the ftp ?
> In don't want to use ftp commands if possible.
>
> Cheers.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/