FileRetrieverConnection connection = null;
try {
connection = getConnection();
response.setContentType("application/x-download");
response.setHeader("Content-Disposition", "attachment; filename=" + file);
connection.retrieve(file, response.getOutputStream());
} catch (FileNotFoundException fnfe) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
} catch (Exception e) {