src/share/jaxws_classes/com/sun/xml/internal/ws/encoding/MimeCodec.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -116,16 +116,18 @@
         if (msg == null) {
             return null;
         }
         ContentTypeImpl ctImpl = (ContentTypeImpl)getStaticContentType(packet);
         String boundary = ctImpl.getBoundary();
+        String rootId = ctImpl.getRootId();
         boolean hasAttachments = (boundary != null);
         Codec rootCodec = getMimeRootCodec(packet);
         if (hasAttachments) {
             writeln("--"+boundary, out);
             ContentType ct = rootCodec.getStaticContentType(packet);
             String ctStr = (ct != null) ? ct.getContentType() : rootCodec.getMimeType();
+            if (rootId != null) writeln("Content-ID: " + rootId, out);
             writeln("Content-Type: " + ctStr, out);
             writeln(out);
         }
         ContentType primaryCt = rootCodec.encode(packet, out);