Author: bmaxwell
Date: 2011-05-07 03:37:46 -0400 (Sat, 07 May 2011)
New Revision: 14310
Modified:
stack/native/branches/jbossws-native-3.1.2/
stack/native/branches/jbossws-native-3.1.2/modules/core/
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests/
Log:
[JBPAPP-6355] Use ByteArrayDataSource to create all DataHandlers
Property changes on: stack/native/branches/jbossws-native-3.1.2
___________________________________________________________________
Modified: svn:mergeinfo
- /stack/native/trunk:12502,13992,14181
+ /stack/native/trunk:12502,13992,14181,14183
Property changes on: stack/native/branches/jbossws-native-3.1.2/modules/core
___________________________________________________________________
Modified: svn:mergeinfo
- /stack/native/trunk/modules/core:12502,13992,14011,14181
+ /stack/native/trunk/modules/core:12502,13992,14011,14181,14183
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java 2011-05-07
07:36:24 UTC (rev 14309)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java 2011-05-07
07:37:46 UTC (rev 14310)
@@ -102,20 +102,11 @@
public String addMtomAttachment(byte[] data, int offset, int length,
String mimeType, String elementNamespace, String
elementLocalName)
{
-
- DataHandler dh = null;
- String contentType = "application/octet-stream";
- if (mimeType.contains("xml") || mimeType.contains("text") ||
mimeType.contains("html"))
- {
- contentType = mimeType;
- ByteArrayDataSource ds = new ByteArrayDataSource(data, offset, length);
- ds.setContentType(contentType);
- dh = new DataHandler(ds);
- } else {
- dh = new DataHandler(data, contentType);
- }
-
-
+
+ String contentType = mimeType == null ? "application/octet-stream" :
mimeType;
+ ByteArrayDataSource ds = new ByteArrayDataSource(data, offset, length);
+ ds.setContentType(contentType);
+ DataHandler dh = new DataHandler(ds);
return addMtomAttachment(dh, elementNamespace, elementLocalName);
}
Property changes on:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/native-tests
___________________________________________________________________
Modified: svn:mergeinfo
- /stack/native/trunk/modules/testsuite/native-tests:12502,13992,14013,14181
+ /stack/native/trunk/modules/testsuite/native-tests:12502,13992,14013,14181,14183
Show replies by date