title: Downloading files from FTP Server where directory changed dynamically
body: <p>I am using Spring Integration to download/upload files from FTP server.</p>
  
  <p>How can I change <code>remote-directory="/directory Name"</code> dynamically in Spring FTP:Inbound-Channel.</p>
  
  <p>My client will create a folder daily basically in <code>"MM-dd-yy"</code> format and copy all files there.
  In "FTP:Inbound-channel" I did not find any way to configure this pattern. I basically have
  to hardcord the directory or file names in configuration.
  What I want is to set the path programatically. Because some times I need to download all files
  from a direcotory or download only a specific file.</p>
  
  <p>I found <code>"remote-directory-expression="'directory'+'/'+ new java.text.SimpleDateFormat('dd-MM-yyyy').format(new java.util.Date())"</code> can be set in FTP:Outbound-channel
  is there any such attribute in FTP:InBound-channel</p>
  
  <p>My configuration is like this:</p>
  
  <pre><code>&lt;bean id="ftpClientFactory"
      class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory"&gt;
      &lt;property name="host" value="${host}" /&gt;
      &lt;property name="port" value="${availableServerPort}" /&gt;
      &lt;property name="username" value="${userid}" /&gt;
      &lt;property name="password" value="${password}" /&gt;
  &lt;/bean&gt;
  
  &lt;int-ftp:inbound-channel-adapter id="ftpInbound"
      cache-sessions="false" channel="ftpChannel" session-factory="ftpClientFactory"
      filename-pattern="*.txt" auto-create-local-directory="true"
      delete-remote-files="false" remote-directory="/filedirectory"
      local-directory="${local_directory}"&gt;
      &lt;int:poller fixed-rate="1000" /&gt;
  &lt;/int-ftp:inbound-channel-adapter&gt;
  
  &lt;int:channel id="ftpChannel"&gt;
      &lt;int:queue /&gt;
  &lt;/int:channel&gt;
  </code></pre>
  
  <p>I did not find a way to do all the above items.</p>
  
  <p>Please let me know how can I achieve this.</p>