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

	<context:property-placeholder/>

	<util:constant id="temporaryFolder"
				   static-field="org.springframework.integration.file.config.FileOutboundGatewayParserTests.tempFolder"/>

	<int-file:outbound-gateway id="ordered"
							   request-channel="someChannel" reply-timeout="777" directory="#{temporaryFolder.root}"
							   auto-startup="false" order="777" filename-generator-expression="'foo.txt'"/>

	<int-file:outbound-gateway id="gatewayWithDirectoryExpression"
							   request-channel="someChannel" directory-expression="temporaryFolder.root"
							   auto-startup="false" order="777" filename-generator-expression="'foo.txt'"
							   requires-reply="false">
		<int-file:request-handler-advice-chain>
			<beans:bean class="org.springframework.integration.file.config.FileOutboundGatewayParserTests$FooAdvice"/>
		</int-file:request-handler-advice-chain>
	</int-file:outbound-gateway>

	<int-file:outbound-gateway id="gatewayWithReplaceMode"
							   request-channel="gatewayWithReplaceModeChannel"
							   filename-generator-expression="'fileToAppend.txt'" mode="REPLACE"
							   directory="#{temporaryFolder.root}" requires-reply="false"/>

	<int-file:outbound-gateway id="gatewayWithAppendMode"
							   request-channel="gatewayWithAppendModeChannel"
							   filename-generator-expression="'fileToAppend.txt'" mode="APPEND"
							   directory="#{temporaryFolder.root}"/>

	<int-file:outbound-gateway id="gatewayWithFailMode"
							   request-channel="gatewayWithFailModeChannel"
							   filename-generator-expression="'fileToAppend.txt'" mode="FAIL"
							   directory="#{temporaryFolder.root}"/>

	<int-file:outbound-gateway id="gatewayWithIgnoreMode"
							   request-channel="gatewayWithIgnoreModeChannel"
							   filename-generator-expression="'fileToAppend.txt'" mode="IGNORE"
							   directory="#{temporaryFolder.root}"/>

	<int-file:outbound-gateway id="gatewayWithFailModeLowercase"
							   request-channel="gatewayWithFailModeLowercaseChannel"
							   filename-generator-expression="'fileToAppend.txt'" mode="fail"
							   directory="#{temporaryFolder.root}"/>

	<int-file:outbound-gateway id="gatewayWithAppendNewLine"
							   request-channel="gatewayWithAppendNewLineChannel"
							   filename-generator-expression="'fileToAppend.txt'"
							   append-new-line="true"
							   directory="#{temporaryFolder.root}"/>

</beans:beans>
