Skip to content

Instantly share code, notes, and snippets.

@manikmagar
Created January 8, 2017 00:12
Show Gist options
  • Save manikmagar/39df8ce4d1184bd4170a8899a89f4678 to your computer and use it in GitHub Desktop.
Save manikmagar/39df8ce4d1184bd4170a8899a89f4678 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd">
<spring:beans>
<spring:bean id="fileFilterWrapper" name="fileFilterWrapper" class="com.mms.mule.filefilters.FileFilterWrapper">
<spring:property name="ioFileFilter" ref="sizeFileFilter"/>
</spring:bean>
<spring:bean id="prefixFileFilter" name="prefixFileFilter" class="org.apache.commons.io.filefilter.PrefixFileFilter">
<spring:constructor-arg index="0" type="java.lang.String" value="tes"/>
</spring:bean>
<spring:bean id="sizeFileFilter" name="sizeFileFilter" class="org.apache.commons.io.filefilter.SizeFileFilter">
<spring:constructor-arg index="0" value="10240"/>
<!-- accept smaller files only -->
<spring:constructor-arg index="1" value="false"/>
</spring:bean>
</spring:beans>
<flow name="filefilterdemoFlow">
<file:inbound-endpoint path="input" moveToDirectory="output" responseTimeout="10000" doc:name="File"
>
<filter ref="fileFilterWrapper"></filter>
</file:inbound-endpoint>
<file:file-to-string-transformer doc:name="File to String"/>
<logger message="#['Received:'+ message.inboundProperties.originalFilename]" level="INFO" doc:name="Logger"/>
</flow>
</mule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment