我能夠將文件從遠程機器複製到本地,但無法將文件移動到遠程服務器中的處理文件夾。春季集成sftp無法將文件移動到遠程文件夾中處理
<bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<property name="host" value="test.com"/>
<property name="user" value="test"/>
<property name="password" value="test123"/>
<property name="port" value="22"/>
</bean>
<int:publish-subscribe-channel id="publishToSFTPChannel" />
<sftp:inbound-channel-adapter local-directory="#{articlesLocalDirectory}" filename-pattern="*.xml" channel="publishToSFTPChannel" session-factory="sftpSessionFactory" remote-directory="#{articlesRemoteDirectory}">
<int:poller fixed-rate="12000"/>
</sftp:inbound-channel-adapter>
<file:outbound-channel-adapter id="moveProcessedFile"
session-factory="sftpSessionFactory"
channel="publishToSFTPChannel"
directory="#{articlesRemoteDirectory}/processed"
delete-source-files="true" />
我不能將文件移動到處理文件夾在遠程FTP
你想達到什麼目的?您希望將文件從SFTP服務器下載到本地目錄,然後將相同的文件移動到同一臺SFTP服務器上的另一個目錄中?你的配置不適用於此。你有文件出站適配器,它只會將文件複製到本地目錄,而不是遠程,並且你不需要'session-factory'。請準確地描述你想要做什麼,因爲你在問題中說的和我在配置中看到的是不同的東西。 –
@Dmitry再次感謝。我想要實現的是我想將文件從FTP複製到本地目錄。複製該文件後,我需要將FTP中的文件移動到同一遠程目錄中的已處理文件夾。 – sree