Author: fmui
Date: Thu Jun 17 15:29:06 2010
New Revision: 955639

URL: http://svn.apache.org/viewvc?rev=955639&view=rev
Log:
preparation for CMIS-217: OSGi support

Modified:
    
incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Converter.java

Modified: 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Converter.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/Converter.java?rev=955639&r1=955638&r2=955639&view=diff
==============================================================================
--- 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Converter.java
 (original)
+++ 
incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/Converter.java
 Thu Jun 17 15:29:06 2010
@@ -2327,9 +2327,15 @@ public final class Converter {
         result.setMimeType(contentStream.getMimeType());
         if (contentStream.getStream() != null) {
             try {
-                if (contentStream.getStream() instanceof StreamingDataHandler) 
{
-                    result.setStream(((StreamingDataHandler) 
contentStream.getStream()).readOnce());
-                } else {
+                try {
+                    if (contentStream.getStream() instanceof 
StreamingDataHandler) {
+                        result.setStream(((StreamingDataHandler) 
contentStream.getStream()).readOnce());
+                    } else {
+                        
result.setStream(contentStream.getStream().getInputStream());
+                    }
+                } catch (NoClassDefFoundError cnfe) {
+                    // Fallback in case the JAX-WS RI is not available 
(optional
+                    // resolution in OSGi)
                     
result.setStream(contentStream.getStream().getInputStream());
                 }
             } catch (IOException e) {


Reply via email to