Skip to content

Instantly share code, notes, and snippets.

@sw360cab
Created March 19, 2012 15:42
Show Gist options
  • Save sw360cab/2116674 to your computer and use it in GitHub Desktop.
Save sw360cab/2116674 to your computer and use it in GitHub Desktop.
mule file
<!-- TODO: remove autodelete / insert fileAge -->
<file:connector name="inputfileObjectConnector" autoDelete="false" pollingFrequency="2000000" recursive="true"> <!-- autoDelete="false" -->
<service-overrides messageFactory="org.mule.transport.file.FileMuleMessageFactory" />
</file:connector>
<flow name="edition">
<!-- #1 - Read video file input -->
<file:inbound-endpoint path="${fs.path.root}${fs.path.untranscoded}" connector-ref="inputfileObjectConnector" comparator="org.mule.transport.file.comparator.OlderFirstComparator" > <!-- 900s -> 15min -->
<!-- <file:filename-wildcard-filter pattern=".avi,.mp4"/> -> does not work -->
<!-- <file:filename-regex-filter pattern=".*\.(avi|mp4|mov)"/> -->
</file:inbound-endpoint>
<!-- <flow-ref name="video-archive" /> -->
<logger level="DEBUG" message=">>>>#[groovy:message.getOutboundProperty('originalFilename')]"/>
<choice>
<when evaluator="groovy" expression="message.getOutboundProperty('originalFilename') ==~ /.*\.(mov|avi|mp4|mpg|mpeg)$/">
<logger level="DEBUG" message="Route video"/>
</when>
<when evaluator="groovy" expression="message.getOutboundProperty('originalFilename') ==~ /.*\.(txt|doc|pdf|srt|xml)$/">
<logger level="DEBUG" message="Route txt"/>
</when>
<otherwise>
<logger level="DEBUG" message="Route anything else"/>
</otherwise>
</choice>
</flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment