cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1104697 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
Date Wed, 18 May 2011 06:28:11 GMT
Author: ffang
Date: Wed May 18 06:28:11 2011
New Revision: 1104697

URL: http://svn.apache.org/viewvc?rev=1104697&view=rev
Log:
[CXF-3505]CXF attachment doesn't compatible with SUN's ACTIVATION library

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java?rev=1104697&r1=1104696&r2=1104697&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java Wed May
18 06:28:11 2011
@@ -285,9 +285,9 @@ public final class AttachmentUtil {
             } catch (UnsupportedEncodingException ue) {
                 contentId = contentId.substring(4);
             }
-            return new LazyDataSource(contentId, atts);
+            return loadDataSource(contentId, atts);
         } else if (contentId.indexOf("://") == -1) {
-            return new LazyDataSource(contentId, atts);
+            return loadDataSource(contentId, atts);
         } else {
             try {
                 return new URLDataSource(new URL(contentId));
@@ -297,5 +297,12 @@ public final class AttachmentUtil {
         }
         
     }
+
+    private static DataSource loadDataSource(String contentId, Collection<Attachment>
atts) {
+        LazyDataSource lazyDS =  new LazyDataSource(contentId, atts);
+        //ensure the attachment DS is loaded to make it also work with SUN's activation lib
+        lazyDS.getContentType();
+        return lazyDS;
+    }
     
 }



Mime
View raw message