File2
Inbuilt file system watch and filter component: files/folders can be filtered and react to multiple selection criteria and optionally moved upon selection for processing.
For more information about File2: https://camel.apache.org/file2.html.
Example¶
Template: Dev_BaseRoute.groovy
${addRoutes}
:=
// Copy *.xml from "/opt/p6core.data/resources/ftp.in" to "/opt/p6core.data/tmp" and original files moved to ".processed" subdirectory
from("file:/opt/p6core.data/resources/ftp.in?antInclude=*.xml&move=.processed")
.to("file:/opt/p6core.data/tmp")
// Call script to process the moved input file
.to( "p6cmb://scripts?platform6.request.action=execute&id=RestTank" )
.routeId("myFile2Route")
${destroyRoutes}
:=
p6.camel.destroyRoute('myFile2Route')