<?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:int="http://www.springframework.org/schema/integration"
	xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp"
	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/sftp https://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd">

	<bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
		<property name="host" value="localhost"/>
		<property name="knownHostsResource"
						value="#{ new org.springframework.core.io.ByteArrayResource('local, foo.com, bar.foo'.bytes)}"/>
		<property name="privateKey" value="classpath:org/springframework/integration/sftp/config/sftp_rsa"/>
		<property name="privateKeyPassphrase" value="ghj"/>
		<property name="password" value="hello"/>
		<property name="port" value="2222"/>
		<property name="user" value="oleg"/>
	</bean>

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

	<int-sftp:inbound-channel-adapter id="sftpAutoStartup"
			session-factory="sftpSessionFactory"
			channel="requestChannel"
			filename-regex="f[o]+\.txt"
			remote-directory="/foo"
			local-directory="file:local-test-dir"
			auto-create-local-directory="false"
			remote-file-separator="."
			temporary-file-suffix=".bar"
			delete-remote-files="false"
			auto-startup="false">
		<int:poller fixed-rate="1000"/>
	</int-sftp:inbound-channel-adapter>

</beans>
