title: Apache Camel URI filter in Java DSL
body: <p>So maybe I'm missing something obvious, which is very possible!</p>
  
  <p>However, I want to migrate a route from Spring to Java.  This route is something like:</p>
  
  <pre><code>&lt;bean id="myFilter" class="my.filter.MyFilter /&gt;
  &lt;route&gt;
  &lt;from uri="ftp://someplace?filter=#myFilter" /&gt;
  &lt;to uri=(....) /&gt;
  &lt;/route&gt;
  </code></pre>
  
  <p>When converting to Java DSL I thought the following would be equivalent, but it's not.  I get different behavior than I thought I would:</p>
  
  <pre><code>MyFilter m = new MyFilter();
  .........
  from("ftp://someplace")
  .filter().method(m)
  .to(....)
  ;
  </code></pre>
  
  <p>The way above seems to retrieve the files from the FTP server and then filter, one by one.</p>
  
  <p>Whereas the Spring way, with the filter option in the URI, seems to filter out all the results I don't want first, then continue on its merry little way.</p>
  
  <p>Is there a way to recreate the functionality of the filter as part of the URI in Java DSL?</p>
  
  <p>I'm assuming I'd have to declare a bean in some fashion in order to be able to use it, but the documentation I'm finding doesn't seem to be clear on how I can achieve this.</p>