chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1182897 - /chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.java
Date Thu, 13 Oct 2011 15:10:12 GMT
Author: fmui
Date: Thu Oct 13 15:10:12 2011
New Revision: 1182897

URL: http://svn.apache.org/viewvc?rev=1182897&view=rev
Log:
CMIS-449:  rendition.getContentStream() now returns if the rendition has no content (!?!)

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.java?rev=1182897&r1=1182896&r2=1182897&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.java
Thu Oct 13 15:10:12 2011
@@ -26,6 +26,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.api.Rendition;
 import org.apache.chemistry.opencmis.client.api.Session;
 import org.apache.chemistry.opencmis.commons.data.ContentStream;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
 import org.apache.chemistry.opencmis.commons.impl.dataobjects.RenditionDataImpl;
 
 /**
@@ -82,8 +83,15 @@ public class RenditionImpl extends Rendi
             return null;
         }
 
-        ContentStream contentStream = session.getBinding().getObjectService()
-                .getContentStream(session.getRepositoryInfo().getId(), objectId, streamId,
null, null, null);
+        ContentStream contentStream;
+        try {
+            contentStream = session.getBinding().getObjectService()
+                    .getContentStream(session.getRepositoryInfo().getId(), objectId, streamId,
null, null, null);
+        } catch (CmisConstraintException e) {
+            // no content stream
+            return null;
+        }
+
         if (contentStream == null) {
             return null;
         }



Mime
View raw message