Skip to content

Instantly share code, notes, and snippets.

@albinkjellin
Last active August 29, 2015 14:16
Show Gist options
  • Save albinkjellin/07a7b6e462a908de1549 to your computer and use it in GitHub Desktop.
Save albinkjellin/07a7b6e462a908de1549 to your computer and use it in GitHub Desktop.
rest2file
<flow name="main">
<http:inbound-endpoint address="http://localhost:8884/api" doc:name="HTTP" exchange-pattern="request-response" />
<apikit:router config-ref="apiConfig" doc:name="APIkit Router" />
</flow>
<flow name="post:/contact/{contactId}/datasheet:apiConfig">
<set-payload value="#[message.inboundAttachments]" doc:name="Retrieve Attachments"/>
<foreach doc:name="For Each">
<set-payload value="#[payload.getInputStream() ]" doc:name="Get Inputstream from Payload"/>
<file:outbound-endpoint path="src/test/resources/rest/attachment/out" responseTimeout="10000" doc:name="File" outputPattern="#[server.dateTime.toString()].pdf"/>
</foreach>
<set-payload value="{&quot;status&quot;:&quot;success&quot;}" doc:name="Generate JSON Response" />
</flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment