Mercurial > dive4elements > gnv-client
diff gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java @ 36:ad381cc47217
Format Code to max 80 Chars per Row
gnv/trunk@172 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 02 Oct 2009 08:54:13 +0000 |
parents | 25fdec8b4c69 |
children | fccf90761825 |
line wrap: on
line diff
--- a/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Fri Oct 02 08:49:18 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Fri Oct 02 08:54:13 2009 +0000 @@ -10,7 +10,7 @@ /** * @author Tim Englich <tim.englich@intevation.de> - * + * */ public class DoExportAction extends DoOutputAction { @@ -18,7 +18,7 @@ * the logger, used to log exceptions and additonaly information */ private static Logger log = Logger.getLogger(DoExportAction.class); - + /** * Constructor */ @@ -32,21 +32,22 @@ log.debug("DoExportAction.setHeaders"); try { super.setHeaders(target, mimeType, response, request); - String fileName = "GNVEXPORT_"+System.currentTimeMillis()+"."; - - if (target.equalsIgnoreCase("chart")){ - fileName = fileName + mimeType.substring(mimeType.indexOf("/")+1); - }else if (target.equalsIgnoreCase("CSV")){ - fileName = fileName +"csv"; - }else{ - fileName = fileName +"txt"; + String fileName = "GNVEXPORT_" + System.currentTimeMillis() + "."; + + if (target.equalsIgnoreCase("chart")) { + fileName = fileName + + mimeType.substring(mimeType.indexOf("/") + 1); + } else if (target.equalsIgnoreCase("CSV")) { + fileName = fileName + "csv"; + } else { + fileName = fileName + "txt"; } - log.debug("FileName for Export: "+fileName); - response.setHeader("Content-Disposition","attachment;filename="+fileName); + log.debug("FileName for Export: " + fileName); + response.setHeader("Content-Disposition", "attachment;filename=" + + fileName); } catch (Exception e) { - log.error(e,e); + log.error(e, e); } } - }