@RequestMapping(method = RequestMethod.POST, value = "/download/applicationpicker/{formName}", consumes = "application/json", produces = "application/pdf")
public void printInitialApplicationPDF(HttpServletResponse response, @PathVariable String formName, @RequestBody ArrayList uids) {
String fileName = formName + ".pdf";
response.setHeader("Content-disposition", "attachment; filename=" + fileName);
ServletOutputStream out = null;
FileInputStream in = null;
try {
downloadService.getApplicationPickerData(uids, "initial");
in = new FileInputStream(ProductConstants.getDataFeedRoot() + ProductConstants.INITIAL_APP_FORM);
out = response.getOutputStream();
IOUtils.copy(in, out);
out.flush();
} catch (IOException ioe) {
log.info("Error exporting file " + fileName);
} finally {
try {
out.close();
} catch (IOException e) {
log.info("Error Closing ServletOutputStream while wrting file " + fileName);
}
}