1 Reply Latest reply on Aug 4, 2009 11:29 AM by Claus Ibsen

    FTP check file exists

    vector_jdev.work Newbie

      I need to get file from FTP and handle it with bean.

      If there is no file on FTP to handle - then I need to send an email.

      I have a route:


      <from uri="ftp://my_login@myftp.com/myfile.txt?consumer.delay=5000//my_login@myftp.com/myfile.txt?consumer.delay=5000"/>

      <to uri="file://c:/!!?expression=downloaded/$/$"/>



            <javaScript>request.headers.get('org.apache.camel.file.name.produced') != null</javaScript>


                   <constant>HANDLE FILE!!!</constant>


                <to uri="log:cat_nc?showAll=true&amp;multiline=true"/>




                   <constant>SEND MAIL!!</constant>


              <to uri="log:cat_nc?showAll=true&amp;multiline=true"/>




      When I have myfile.txt on FTP it's working OK. When there is no any file the whole route is stopped on File with name $ doesn't exists</constant>



      The above expression doesn't work




      Edited by: vector on Aug 4, 2009 2:35 PM