Basically I need to provide REST service that would receive a String param, use that param to fetch a file from another system and then return the fetched file back as the response.
The effect should be the same as when a user clicks on a pdf or any other binary file link and the browser prompts him to save/download that file.
A couple of points:
- is it possible to stream the file (to send bytes as I receive them from source system). In other words, how to handle very large files?
- also related to streaming, when using regular HttpServletResponse, do I have to wait until a large file is completely read to
return response.build()
?
How do I go around doing this using Apache Wink?
PS Sorry, this may be trivial for Wink gurus, but I'm just starting to wrap my head around developer guide.