chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1672022 - /chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/
Date Wed, 08 Apr 2015 07:51:45 GMT
Author: fmui
Date: Wed Apr  8 07:51:44 2015
New Revision: 1672022

URL: http://svn.apache.org/r1672022
Log:
Client: AtomPub: consume responses that are not processed (see CMIS-903)

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java?rev=1672022&r1=1672021&r2=1672022&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
Wed Apr  8 07:51:44 2015
@@ -77,6 +77,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisVersioningException;
 import org.apache.chemistry.opencmis.commons.impl.Constants;
+import org.apache.chemistry.opencmis.commons.impl.IOUtils;
 import org.apache.chemistry.opencmis.commons.impl.ReturnVersion;
 import org.apache.chemistry.opencmis.commons.impl.UrlBuilder;
 import org.apache.chemistry.opencmis.commons.impl.XMLConverter;
@@ -665,6 +666,15 @@ public abstract class AbstractAtomPubSer
     }
 
     /**
+     * Performs a POST on an URL, checks the response code and consumes the
+     * response.
+     */
+    protected void postAndConsume(UrlBuilder url, String contentType, Output writer) {
+        Response resp = post(url, contentType, writer);
+        IOUtils.consumeAndClose(resp.getStream());
+    }
+
+    /**
      * Performs a PUT on an URL, checks the response code and returns the
      * result.
      */

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java?rev=1672022&r1=1672021&r2=1672022&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java
Wed Apr  8 07:51:44 2015
@@ -64,7 +64,7 @@ public class MultiFilingServiceImpl exte
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId),
getCmisVersion(repositoryId));
 
         // post addObjectToFolder request
-        post(url, Constants.MEDIATYPE_ENTRY, new Output() {
+        postAndConsume(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws XMLStreamException, IOException {
                 entryWriter.write(out);
             }
@@ -90,7 +90,7 @@ public class MultiFilingServiceImpl exte
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId),
getCmisVersion(repositoryId));
 
         // post removeObjectFromFolder request
-        post(url, Constants.MEDIATYPE_ENTRY, new Output() {
+        postAndConsume(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws XMLStreamException, IOException {
                 entryWriter.write(out);
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java?rev=1672022&r1=1672021&r2=1672022&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java
Wed Apr  8 07:51:44 2015
@@ -66,7 +66,7 @@ public class PolicyServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId),
getCmisVersion(repositoryId));
 
         // post applyPolicy request
-        post(url, Constants.MEDIATYPE_ENTRY, new Output() {
+        postAndConsume(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws XMLStreamException, IOException {
                 entryWriter.write(out);
             }



Mime
View raw message