public void downloadArticle(String folderPath, String articleName, HttpServletResponse response) {
FileInputStream inputStream = null;
OutputStream out = null;
try {
response.reset();
response.setContentType("application/force-download");
response.setHeader("Content-Disposition", "attachment;filename=" + UUIDUtils.getUUID() +".pdf");
File file = new File(filePath + folderPath+"/"+articleName+".pdf");
inputStream = new FileInputStream(file);
out = response.getOutputStream();
int length = 0;
byte[] buffer = new byte[1024];
while ((length = inputStream.read(buffer)) != -1) {
out.write(buffer, 0, length);
}
inputStream.close();
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}