← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20140: CSV event export, should not call close explicitly on httpresponse outputstream

 

------------------------------------------------------------
revno: 20140
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-09-14 19:39:27 +0200
message:
  CSV event export, should not call close explicitly on httpresponse outputstream
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/UserSettingController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/view/CustomPathExtensionContentNegotiationStrategy.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/UserSettingController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/UserSettingController.java	2015-07-09 06:47:25 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/UserSettingController.java	2015-09-14 17:39:27 +0000
@@ -151,8 +151,12 @@
     private String getStringValue( String key, Serializable value )
     {
         if ( key.equals( UserSettingService.KEY_UI_LOCALE ) || key.equals( UserSettingService.KEY_DB_LOCALE ) )
+        {
             return ((Locale) value).getLanguage();
+        }
         else
+        {
             return (String) value;
+        }
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventController.java	2015-08-30 17:07:42 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EventController.java	2015-09-14 17:39:27 +0000
@@ -219,8 +219,6 @@
         }
 
         csvEventService.writeEvents( outputStream, events, !skipHeader );
-        response.getOutputStream().flush();
-        response.getOutputStream().close();
     }
 
     @RequestMapping( value = "/eventRows", method = RequestMethod.GET )

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/view/CustomPathExtensionContentNegotiationStrategy.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/view/CustomPathExtensionContentNegotiationStrategy.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/view/CustomPathExtensionContentNegotiationStrategy.java	2015-09-14 17:39:27 +0000
@@ -49,11 +49,11 @@
  */
 public class CustomPathExtensionContentNegotiationStrategy extends PathExtensionContentNegotiationStrategy
 {
-    private static final UrlPathHelper urlPathHelper = new UrlPathHelper();
+    private static final UrlPathHelper URL_PATH_HELPER = new UrlPathHelper();
 
     static
     {
-        urlPathHelper.setUrlDecode( false );
+        URL_PATH_HELPER.setUrlDecode( false );
     }
 
     public CustomPathExtensionContentNegotiationStrategy( Map<String, MediaType> mediaTypes )
@@ -71,7 +71,7 @@
             return null;
         }
 
-        String path = urlPathHelper.getLookupPathForRequest( servletRequest );
+        String path = URL_PATH_HELPER.getLookupPathForRequest( servletRequest );
         String filename = WebUtils.extractFullFilenameFromUrlPath( path );
         String extension = getFilenameExtension( filename );
         return (StringUtils.hasText( extension )) ? extension.toLowerCase( Locale.ENGLISH ) : null;