cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: r436709 - /incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/attachment/AttachmentUtil.java
Date Fri, 25 Aug 2006 08:10:04 GMT
Author: tli
Date: Fri Aug 25 01:10:03 2006
New Revision: 436709

URL: http://svn.apache.org/viewvc?rev=436709&view=rev
Log:
change a util method of AttachmentUtil

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

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/attachment/AttachmentUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/attachment/AttachmentUtil.java?rev=436709&r1=436708&r2=436709&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/attachment/AttachmentUtil.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/attachment/AttachmentUtil.java
Fri Aug 25 01:10:03 2006
@@ -5,6 +5,9 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 import java.util.UUID;
 
 import javax.xml.ws.WebServiceException;
@@ -47,8 +50,8 @@
     public static String getUniqueBoundaryValue(int part) {
         StringBuffer s = new StringBuffer();
         // Unique string is ----=_Part_<part>_<hashcode>.<currentTime>
-        s.append("----=_Part_").append(part++).append("_").append(s.hashCode()).append('.')
-            .append(System.currentTimeMillis());
+        s.append("----=_Part_").append(part++).append("_").append(s.hashCode()).append('.').append(
+                        System.currentTimeMillis());
         return s.toString();
     }
 
@@ -66,12 +69,18 @@
         return buffer.toString();
     }
 
-    public static String getMimeRequestHeader(Message message, String soapPartId, String
contentDesc) {
-        StringBuffer buffer = new StringBuffer(200);
-        buffer.append("MIME-Version: 1.0\n");
-        buffer.append("Content-Type: Multipart/" + getMimeSubType(message, soapPartId) +
"\n");
-        buffer.append("Content-Description: " + contentDesc + "\n");
-        return buffer.toString();
+    public static void setMimeRequestHeader(Map<String, List<String>> reqHeaders,
Message message,
+                    String soapPartId, String contentDesc) {
+        List<String> header1 = new ArrayList<String>();
+        header1.add("1.0");
+        reqHeaders.put("MIME-Version", header1);
+        List<String> header2 = new ArrayList<String>();
+        header2.add("Multipart/" + getMimeSubType(message, soapPartId));
+        reqHeaders.put("Content-Type", header2);
+        List<String> header3 = new ArrayList<String>();
+        header3.add(contentDesc);
+        reqHeaders.put("Content-Description", header3);
+
     }
 
     public static String getMimeSubType(Message message, String soapPartId) {



Mime
View raw message