chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r1189795 - /chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/RenditionImpl.java
Date Thu, 27 Oct 2011 14:58:17 GMT
Author: fguillaume
Date: Thu Oct 27 14:58:16 2011
New Revision: 1189795

URL: http://svn.apache.org/viewvc?rev=1189795&view=rev
Log:
CMIS-459: fill more info on AtomPub rendition content streams

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=1189795&r1=1189794&r2=1189795&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 27 14:58:16 2011
@@ -96,9 +96,17 @@ public class RenditionImpl extends Rendi
             return null;
         }
 
-        long length = contentStream.getBigLength() == null ? -1 : contentStream.getBigLength().longValue();
+        String filename = contentStream.getFileName();
+        if (filename == null) {
+            filename = getTitle();
+        }
+        BigInteger bigLength = contentStream.getBigLength();
+        if (bigLength == null) {
+            bigLength = getBigLength();
+        }
+        long length = bigLength == null ? -1 : bigLength.longValue();
 
-        return session.getObjectFactory().createContentStream(contentStream.getFileName(),
length,
+        return session.getObjectFactory().createContentStream(filename, length,
                 contentStream.getMimeType(), contentStream.getStream());
     }
 



Mime
View raw message