usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [1/3] usergrid git commit: Added a buffer in front of every JSON generator.
Date Thu, 01 Oct 2015 23:03:27 GMT
Repository: usergrid
Updated Branches:
  refs/heads/export-feature f4087473d -> ade6e7881


Added a buffer in front of every JSON generator.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/92047328
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/92047328
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/92047328

Branch: refs/heads/export-feature
Commit: 920473287103ac68dca76162e824123a3d455beb
Parents: f408747
Author: George Reyes <grey@apache.org>
Authored: Wed Sep 30 16:30:51 2015 -0700
Committer: George Reyes <grey@apache.org>
Committed: Wed Sep 30 16:30:51 2015 -0700

----------------------------------------------------------------------
 .../management/export/ExportServiceImpl.java       | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/92047328/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
index 3d5b1a9..9079d65 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
@@ -17,7 +17,11 @@
 package org.apache.usergrid.management.export;
 
 
+import java.io.BufferedOutputStream;
+import java.io.BufferedWriter;
 import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FilterWriter;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.ArrayList;
@@ -581,16 +585,9 @@ public class ExportServiceImpl implements ExportService {
     protected JsonGenerator getJsonGenerator( File ephermal ) throws IOException {
         //TODO:shouldn't the below be UTF-16?
 
-        JsonGenerator jg = jsonFactory.createGenerator( ephermal, JsonEncoding.UTF8 );
-        jg.setPrettyPrinter( new MinimalPrettyPrinter( "" ) );
-        jg.setCodec( new ObjectMapper() );
-        return jg;
-    }
-
-    protected JsonGenerator getJsonGenerator( OutputStream outputStream ) throws IOException
{
-        //TODO:shouldn't the below be UTF-16?
-        //TODO:do
-        JsonGenerator jg = jsonFactory.createGenerator( outputStream,JsonEncoding.UTF16_LE
);
+        FileOutputStream fileOutputStream = new FileOutputStream( ephermal );
+        OutputStream entityOutputStream = new BufferedOutputStream( fileOutputStream );
+        JsonGenerator jg = jsonFactory.createGenerator( entityOutputStream, JsonEncoding.UTF16_LE
);
         jg.setPrettyPrinter( new MinimalPrettyPrinter( "" ) );
         jg.setCodec( new ObjectMapper() );
         return jg;


Mime
View raw message