There is a download=false option you can set. See details at the camel ftp doc

On Fri, Nov 7, 2014 at 3:57 PM, erik_romson <e...@zenior.no> wrote:
> Hi all,
> I'm trying to understand how to fix the following.
>
> setup:
> 1: send in a file to ftpserver
> 2: the file is later moved to another folder by another process
>
> in a route, I want to
> 1: read file name(s) from database (select filename from atable where
> state='file_not_moved')
> 2: check that file exists in ftpserver/folder
> 3: [true] update  atable set status='file_moved' where
> state='file_not_moved' and filename=:filname
>
> I haven't understood the *best* way of doing this
>
> Scenario1 (using IdempotentRepository )
> I have however solved this to poll the complete folder and a custom
> IdempotentRepository (that updates the state in the table). This however
> scans the complete folder (I use a FileFilter to limit it somewhat) and the
> folder can be quite big (grows with 6000 files a day)
>
> from("file://urltoprocessedfolder&noop=true&idempotent=true&idempotentRepository=#idempotentXmlProcessed&sortBy=file:modified?filter=#xmlFilter"
> )
>                         .log(LoggingLevel.ERROR, logger, "writing idempotent
> to ${id}")
>                         .to("mock:end");
>
>
> Scenario2 (using enrich)
>
> from("sql:select filename from atable where state='file_not_moved'")
>
> .enrich("file://urltoprocessedfolder?noop=true&readLock=none&fileName=${header.filename}");
>
> this works but it seems shady somehow
>
>
> Is the *best* way to create a predicate that actually check if the file
> exists? like (not correct code)
>
>  from("sql:select filename from atable where state='file_not_moved'")
>             .choice()
>                 .when(predicateThatChecksIfFileExists(${filename}))
>                     .to(""sql:update atable set state='file_moved' where
> filename=:#filename")
>                 .otherwise()
>                     .to("dummy:a");
>
> as soon I use the ftpcomponent as a producer, it creates the file...
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/how-to-check-that-a-file-exists-in-ftpserver-tp5758705.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to