FileObject file = commandFactory.getDownloadFileCommand(fileobjectid).execute(credentialFacade);
response.setContentType("application/x-download");
String contentDisposition =
FileUtils.encodeFilename(file.getFilename(), request) ;
response.setHeader("Content-Disposition", "attachment;filename="+ contentDisposition);
response.setHeader("Cache-Control", "max-age=1");
response.setHeader("Pragma", "public");
response.setHeader("Last-Modified", FastHttpDateFormat.formatDate(file.getCreationdate().getTimeInMillis(), null));
response.setStatus(HttpServletResponse.SC_OK);
fileActionFacade.writeFileToOutputStream(response.getOutputStream(), file);
//20131113
getAuditTrailFacade().logEvent(credentialFacade.getAccessUser().getDeptName(),credentialFacade.getAccessUser().getLogin(), file.getFile(), AuditTrailFacade.DOWNLOAD, "File downloaded - " + file.getFile().getNodeFullPath(), credentialFacade.getIpAddress());
return file;