cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r719649 - in /cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment: AttachmentSerializer.java AttachmentUtil.java
Date Fri, 21 Nov 2008 17:38:45 GMT
Author: dkulp
Date: Fri Nov 21 09:38:44 2008
New Revision: 719649

URL: http://svn.apache.org/viewvc?rev=719649&view=rev
Log:
[CXF-1900] Decode the cid used for the Content-ID header

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
    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/AttachmentSerializer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java?rev=719649&r1=719648&r2=719649&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java Fri
Nov 21 09:38:44 2008
@@ -23,6 +23,7 @@
 import java.io.OutputStream;
 import java.io.StringWriter;
 import java.io.Writer;
+import java.net.URLDecoder;
 
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.message.Message;
@@ -125,7 +126,7 @@
         writer.write("Content-Transfer-Encoding: binary\r\n");
 
         writer.write("Content-ID: <");
-        writer.write(attachmentId);
+        writer.write(URLDecoder.decode(attachmentId, "UTF-8"));
         writer.write(">\r\n\r\n");
     }
 

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=719649&r1=719648&r2=719649&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 Fri Nov
21 09:38:44 2008
@@ -44,16 +44,15 @@
     public static String createContentID(String ns) throws UnsupportedEncodingException {
         // tend to change
         String cid = "http://cxf.apache.org/";
-        //String name = UUID.randomUUID().toString();
-        String name = ATT_UUID + String.valueOf(++counter);
+        
+        String name = ATT_UUID + "-" + String.valueOf(++counter);
         if (ns != null && (ns.length() > 0)) {
             try {
                 URI uri = new URI(ns);
                 String host = uri.toURL().getHost();
                 cid = host;
             } catch (URISyntaxException e) {
-                e.printStackTrace();
-                return null;
+                cid = ns;
             } catch (MalformedURLException e) {
                 cid = ns;
             }



Mime
View raw message