title: Spring integration for sftp
body: <p>How can I move file from local system to remote FTP using SFTP adapter. I am going through the examples and all are mentioning to copy files from remote FTP to local machine.</p>
  
  <p>I need to move files from local machine to remote system folder.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:int="http://www.springframework.org/schema/integration"
  xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp"
  xmlns:file="http://www.springframework.org/schema/integration/file"
  xsi:schemaLocation="
      http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/integration
      http://www.springframework.org/schema/integration/spring-integration.xsd
      http://www.springframework.org/schema/integration/sftp
      http://www.springframework.org/schema/integration/sftp/spring-integration-sftp-    2.2.xsd
      http://www.springframework.org/schema/integration/file
      http://www.springframework.org/schema/integration/file/spring-integration-file-2.2.xsd"&gt;
  
  &lt;bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory"&gt;
  &lt;property name="host" value="localhost"/&gt;
  &lt;property name="user" value="user01"/&gt;
  &lt;property name="password" value="abc123"/&gt;
  &lt;property name="port" value="990"/&gt;
  &lt;/bean&gt;
  
  &lt;int:channel id="sftpChannel"/&gt;
  
  &lt;file:inbound-channel-adapter directory="#{T(System).getProperty('java.io.tmpdir')}" id="fileInbound"
                            channel="sftpChannel" filename-pattern="*.xml"&gt;
  &lt;int:poller fixed-rate="1000" max-messages-per-poll="100"/&gt;
  &lt;/file:inbound-channel-adapter&gt;
  
  &lt;int-sftp:outbound-channel-adapter id="sftpOutboundAdapter" session-factory="sftpSessionFactory"
                                 channel="sftpChannel" charset="UTF-8" remote-directory="/"
                                 remote-file-separator="/"/&gt;
  
  &lt;/beans&gt;
  
  &lt;file:outbound-channel-adapter id="moveProcessedFile"
      channel="sftpChannel"
      directory="file:#{configurationService.configuration.getProperty('acal.jde.publish.folder')}/processed"
      delete-source-files="true" order="2" /&gt;
  </code></pre>
  
  <p>I tried this but not able to move file to processed folder.</p>