You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gonzalo Vasquez <gv...@altiuz.cl> on 2012/11/15 17:20:20 UTC

Touch and/or delete files

Are there any components that allow file "touching" or deletion? I actually need both, thanks!

Gonzalo Vásquez Sáez
Gerente Investigación y Desarrollo (R&D)
Altiuz Soluciones Tecnológicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes
(56-2) 335 2461
gvasquez@altiuz.cl
http://www.altiuz.cl
 




Re: Touch and/or delete files

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Nov 15, 2012 at 11:01 PM, Henryk Konsek <he...@gmail.com> wrote:
> Hi Gonzalo,
>
>> Are there any components that allow file "touching" or deletion?
>
> You can tell File component [1] to delete the file, instead of moving
> it. See 'delete' option of the consumer.
>
> File component doesn't support touching the file (as far as I know).
> This is probably because the file producer will update the
> lastModified value of the file, but ignore the body of the message.
> IMHO This is not in sync with File producer logic, as you take the
> timestamp from the message, but ignore the message itself.
>
> If you want to touch the file, use Groovy for example:
>
> from("seda:touchQueue").
>   to("language:groovy:new
> File(request.body).setLastModified(System.currentTimeMillis())");
>

Yeah just write a little bean with methods for deleting or touching a
file. And then use the bean component to invoke these methods.


Or as shown above you can use a scripting language directly in the DSL.


> Best regards.
>
> [1] http://camel.apache.org/file2.html
>
> --
> Henryk Konsek
> http://henryk-konsek.blogspot.com



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Touch and/or delete files

Posted by Henryk Konsek <he...@gmail.com>.
Hi Gonzalo,

> Are there any components that allow file "touching" or deletion?

You can tell File component [1] to delete the file, instead of moving
it. See 'delete' option of the consumer.

File component doesn't support touching the file (as far as I know).
This is probably because the file producer will update the
lastModified value of the file, but ignore the body of the message.
IMHO This is not in sync with File producer logic, as you take the
timestamp from the message, but ignore the message itself.

If you want to touch the file, use Groovy for example:

from("seda:touchQueue").
  to("language:groovy:new
File(request.body).setLastModified(System.currentTimeMillis())");

Best regards.

[1] http://camel.apache.org/file2.html

--
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: Touch and/or delete files

Posted by Christian Müller <ch...@gmail.com>.
No, you have to do it by your own. You could use the Camel bean component
together with commons-io or so...

Sent from a mobile device
Am 15.11.2012 17:20 schrieb "Gonzalo Vasquez" <gv...@altiuz.cl>:

> Are there any components that allow file "touching" or deletion? I
> actually need both, thanks!
>
> *Gonzalo Vásquez Sáez*
> *Gerente Investigación y Desarrollo (R&D)*
> *Altiuz* Soluciones Tecnológicas de Negocios Ltda.
> Av. Nueva Tajamar 555 Of. 802, Las Condes
> (56-2) 335 2461
> *gvasquez@altiuz.c <gc...@altiuz.com>l*
> ***http://www.altiuz.cl*
>
>
>
>