title: Camel File: Stop route when all files are processed
body: <p>I have camel route</p>
  
  <pre><code>&lt;routes xmlns="http://camel.apache.org/schema/spring"&gt;
     &lt;route startupOrder="1"&gt;
      &lt;from uri="file:D:\Work\eclipse_workspace\dataEngine_GIT_2\src\data" /&gt;
        &lt;unmarshal&gt;
          &lt;csv delimiter="|" quoteDisabled="true" /&gt;
      &lt;/unmarshal&gt;
      &lt;to uri="bean:csvProcessor?method=processNew" /&gt;
  &lt;/route&gt;
  
  &lt;/routes&gt;
  </code></pre>
  
  <p>It continuously polls the directory.</p>
  
  <p>I want to stop polling if this job is triggered once.</p>
  
  <p>If all files are processed route should stop</p>
  
  <p>How Can I do this ??</p>
  
  <p>I tried below</p>
  
  <pre><code>&lt;from uri="timer:foo?repeatCount=1" /&gt;
              &lt;pollEnrich&gt;
                  &lt;constant&gt;file:D:\Work\eclipse_workspace\dataEngine_GIT_2\src\data&lt;/constant&gt;
              &lt;/pollEnrich&gt;
  </code></pre>
  
  <p>But it still polls continuously</p>
  
  <p>Note: I am using spring Camel.</p>