title: How to avoid scan or filter a specific directory in Spring Integration?
body: <p>With Spring integration, I would like to use my inbound channel adapter to scan a directory with a tree structure like this:</p>
  
  <pre><code>INDICATOR/
      ref_1/
          INPUTS/
          ERRORS/
      ref_2/
          INPUTS/
          ERRORS/
  </code></pre>
  
  <p>My root directory will be <code>INDICATOR</code> I would like to recursively scan all the directory and get all the files in, exept the ones in the <code>ERRORS</code> directory. In other words, how to <em>deny</em> or <em>avoid</em> scanning this specific directory?</p>
  
  <p>is it possible to implements this class <code>org.springframework.integration.file.RecursiveLeafOnlyDirectoryScanner</code> and add a specific filter?</p>
  
  <p>This is my actual config</p>
  
  <pre><code>&lt;int-file:inbound-channel-adapter id="csvInputChannel"
      directory="file:${directory.input}"
      prevent-duplicates="false"
      auto-startup="true" 
      auto-create-directory="false" 
      queue-size="1"
      scanner="dirScanner"&gt;
  
      &lt;int:poller max-messages-per-poll="1" default="true" fixed-rate="1000" receive-timeout="5000" /&gt;
  &lt;/int-file:inbound-channel-adapter&gt;
  
  &lt;bean id="dirScanner" 
      class="org.springframework.integration.file.RecursiveLeafOnlyDirectoryScanner" /&gt;
  </code></pre>
  
  <p>Actually, I can only scan ALL the files present in ALL the directory recursively, I don' thave a clue how to add a filter.</p>
  
  <p>Thanks in advance for any tips.</p>