I want to modify file with groovy using:
<from uri="file:/data/inbox?delete=true" />
<transform>
<groovy>
body = body[1..3]
</groovy>
</transform>
<to uri="file:/data/outbox"/>
I get an error:
groovy.lang.MissingMethodException: No signature of method: org.apache.camel.component.file.GenericFile.getAt() is applicable for argument types: (groovy.lang.IntRange) values: [1..3]
What am I doing wrong?
body = body[1..3]? In this case the originalbodyis aGenericFileinstance but the groovy scriptbody[1..3]tries to invoke itsgetAt()method with an unsupportedIntRangeargument. - Tadayoshi Sato