dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24921
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12260: Apps, using ObjectMapper method for inputstream instead of first converting to string
------------------------------------------------------------
revno: 12260
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-09-26 17:37:32 +0200
message:
Apps, using ObjectMapper method for inputstream instead of first converting to string
modified:
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/StreamUtils.java
dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AddAppAction.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-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/StreamUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/StreamUtils.java 2013-09-03 18:34:13 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/StreamUtils.java 2013-09-26 15:37:32 +0000
@@ -608,6 +608,7 @@
* @param inputStream the InputStream
* @return String after reading the InputStream
*/
+ @Deprecated
public static String convertStreamToString( InputStream inputStream )
{
Scanner s = new Scanner( inputStream, ENCODING_UTF8 ).useDelimiter( "\\A" );
=== modified file 'dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AddAppAction.java'
--- dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AddAppAction.java 2013-09-03 15:24:51 +0000
+++ dhis-2/dhis-web/dhis-web-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AddAppAction.java 2013-09-26 15:37:32 +0000
@@ -146,10 +146,9 @@
try
{
InputStream inputStream = zip.getInputStream( entry );
- String appManifest = StreamUtils.convertStreamToString( inputStream );
ObjectMapper mapper = new ObjectMapper();
mapper.configure( DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false );
- App app = mapper.readValue( appManifest, App.class );
+ App app = mapper.readValue( inputStream, App.class );
// Delete if app is already installed
if ( appManagerService.getInstalledApps().contains( app ) )