title: Spring Integration File Inbound Adapter Scan Directory Each Poll
body: <p>I would like to enhance my current file inbound channel adapter that will scan the directory to refresh the file listing in the queue for each poll.</p>
  
  <p>Below are the XML config for my current file inbound channel adapter :</p>
  
  <pre><code>&lt;int-file:inbound-channel-adapter id="hostFilesOut" channel="hostFileOutChannel"
      directory="${hostfile.dir.out}" prevent-duplicates="false"
      filename-regex="${hostfile.out.filename-regex}" &gt;
      &lt;int:poller id="poller" cron="${poller.cron:0,4,8,12,16,20,24,28,32,36,40,44,48,52,56 * * * * * }"
          max-messages-per-poll="1" /&gt;
  &lt;/int-file:inbound-channel-adapter&gt; 
  </code></pre>
  
  <p>I have try to create a custom scanner to read file. However, using the scanner to a file inbound channel adapter will cause the cron configuration not working.</p>
  
  <p>Can someone give an advice on this or is there any other way can also achieve the same goal.</p>
  
  <p>Thank you.</p>