Author: dkulp
Date: Mon Jul  7 12:20:23 2008
New Revision: 674604

URL: http://svn.apache.org/viewvc?rev=674604&view=rev
Log:
Merged revisions 674601 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r674601 | dkulp | 2008-07-07 15:18:53 -0400 (Mon, 07 Jul 2008) | 2 lines
  
  [CXF-1665] Remove dead code, try to map byte[] as well.
........

Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    
cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jul  7 12:20:23 2008
@@ -1 +1 @@
-/cxf/trunk:673548,674485,674547,674551,674562
+/cxf/trunk:673548,674485,674547,674551,674562,674601

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java?rev=674604&r1=674603&r2=674604&view=diff
==============================================================================
--- 
cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
 (original)
+++ 
cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
 Mon Jul  7 12:20:23 2008
@@ -35,7 +35,6 @@
 
 import javax.activation.DataHandler;
 import javax.activation.DataSource;
-import javax.activation.URLDataSource;
 import javax.imageio.ImageIO;
 import javax.imageio.ImageWriter;
 import javax.imageio.stream.ImageOutputStream;
@@ -149,9 +148,7 @@
             
             // This code could probably be refactored out somewhere...
             if (o instanceof Source) {
-                
                 dh = new DataHandler(createDataSource((Source)o, ct));
-                
             } else if (o instanceof Image) {
                 // TODO: make this streamable. This is one of my pet
                 // peeves in JAXB RI as well, so if you fix this, submit the 
@@ -191,13 +188,14 @@
                 } catch (IOException e) {
                     //ignore, use same dh
                 }
-            } else if (dh == null) {
+            } else if (o instanceof byte[]) {
+                if (ct == null) {
+                    ct = "application/octet-stream";
+                }
+                dh = new DataHandler(new ByteArrayDataSource((byte[])o, ct));  
              
+            } else {
                 throw new Fault(new 
org.apache.cxf.common.i18n.Message("ATTACHMENT_NOT_SUPPORTED", 
                                                                        LOG, 
o.getClass()));
-            } else if (dh.getDataSource() instanceof URLDataSource) {
-                URLDataSource ds = (URLDataSource)dh.getDataSource();
-                dh = new DataHandler(ds.getURL()); 
-                ct = ds.getContentType();
             }
             
             AttachmentImpl att = new AttachmentImpl(id);


Reply via email to