chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1043384 - in /incubator/chemistry/opencmis/trunk: chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/ chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/...
Date Wed, 08 Dec 2010 12:35:22 GMT
Author: fmui
Date: Wed Dec  8 12:35:21 2010
New Revision: 1043384

URL: http://svn.apache.org/viewvc?rev=1043384&view=rev
Log:
AtomPub server: enabled streaming of base64 content and fixed memory allocation

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractCmisService.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractCmisService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractCmisService.java?rev=1043384&r1=1043383&r2=1043384&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractCmisService.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractCmisService.java
Wed Dec  8 12:35:21 2010
@@ -903,7 +903,6 @@ public abstract class AbstractCmisServic
                 // add object info
                 addObjectInfo(info);
             } catch (Exception e) {
-                e.printStackTrace();
                 info = null;
             } finally {
                 addObjectInfos = true;

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java?rev=1043384&r1=1043383&r2=1043384&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java
Wed Dec  8 12:35:21 2010
@@ -171,6 +171,7 @@ public class AtomEntryParser {
         }
 
         XMLInputFactory factory = XMLInputFactory.newInstance();
+        factory.setProperty(XMLInputFactory.IS_COALESCING, "false");
         XMLStreamReader parser = factory.createXMLStreamReader(stream);
 
         while (true) {
@@ -572,14 +573,18 @@ public class AtomEntryParser {
         }
 
         public LightByteArrayOutputStream(int initSize) {
-            if (size < 0) {
-                throw new IllegalArgumentException("Negative initial size: " + size);
+            if (initSize < 0) {
+                throw new IllegalArgumentException("Negative initial size: " + initSize);
             }
-            buf = new byte[size];
+            buf = new byte[initSize];
         }
 
         private void expand(int i) {
-            int newSize = (size < MAX_GROW ? (size + i) * 2 : size + MAX_GROW);
+            if (size + i <= buf.length) {
+                return;
+            }
+
+            int newSize = ((size + i) * 2 < MAX_GROW ? (size + i) * 2 : buf.length + i
+ MAX_GROW);
             byte[] newbuf = new byte[newSize];
             System.arraycopy(buf, 0, newbuf, 0, size);
             buf = newbuf;



Mime
View raw message