<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:ftp="http://www.springframework.org/schema/integration/ftp"
	   xmlns:int="http://www.springframework.org/schema/integration"
	   xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/integration  https://www.springframework.org/schema/integration/spring-integration.xsd
       http://www.springframework.org/schema/integration/ftp https://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd">

	<bean id="ftpSessionFactory" class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory">
		<property name="host" value="localhost"/>
		<property name="port" value="22"/>
		<property name="username" value="oleg"/>
		<property name="password" value="password"/>
		<property name="clientMode" value="2"/>
		<property name="fileType" value="2"/>
	</bean>

	<ftp:inbound-channel-adapter id="adapterFtp"
								 session-factory="ftpSessionFactory"
								 channel="ftpIn"
								 filename-pattern="foo"
								 local-directory="target/foo"
								 remote-directory="foo/bar"
								 auto-create-local-directory="true"
								 delete-remote-files="false"
								 auto-startup="false">
		<int:poller fixed-rate="1000"/>
	</ftp:inbound-channel-adapter>


	<ftp:inbound-channel-adapter id="adapterFtp2"
								 session-factory="ftpSessionFactory"
								 channel="ftpIn"
								 local-directory="target"
								 remote-directory="foo/bar"
								 auto-create-local-directory="true"
								 delete-remote-files="false"
								 auto-startup="false">
		<int:poller fixed-rate="1000"/>
	</ftp:inbound-channel-adapter>

	<int:channel id="ftpIn">
		<int:queue/>
	</int:channel>

</beans>
