org.apache.axiom.om.impl
Class MIMEOutputUtils

java.lang.Object
  extended by org.apache.axiom.om.impl.MIMEOutputUtils

public class MIMEOutputUtils
extends java.lang.Object

Utility class used to write out XML with Attachments


Field Summary
private static byte[] CRLF
           
 
Constructor Summary
MIMEOutputUtils()
           
 
Method Summary
static void complete(java.io.OutputStream outStream, byte[] xmlData, java.util.LinkedList binaryNodeList, java.lang.String boundary, java.lang.String contentId, java.lang.String charSetEncoding, java.lang.String SOAPContentType)
          Invoked by MTOMXMLStreamWriter to write the SOAP Part and the attachements.
static void complete(java.io.OutputStream outStream, java.lang.String bufferedXML, java.util.LinkedList binaryNodeList, java.lang.String boundary, java.lang.String contentId, java.lang.String charSetEncoding, java.lang.String SOAPContentType)
          Deprecated. is anyone really using this? Invoked by MTOMXMLStreamWriter to write the SOAP Part and the attachemts
static void complete(java.io.OutputStream outStream, java.io.StringWriter writer, java.util.LinkedList binaryNodeList, java.lang.String boundary, java.lang.String contentId, java.lang.String charSetEncoding, java.lang.String SOAPContentType)
          Deprecated. - is anyone really using this? Write the SOAPPart and attachments
static javax.mail.internet.MimeBodyPart createMimeBodyPart(java.lang.String contentID, javax.activation.DataHandler dataHandler)
           
static void finishWritingMime(java.io.OutputStream outStream)
           
static void startWritingMime(java.io.OutputStream outStream, java.lang.String boundary)
           
static void writeBodyPart(java.io.OutputStream outStream, javax.mail.internet.MimeBodyPart part, java.lang.String boundary)
          Writes a CRLF for the earlier boundary then the BodyPart data with headers followed by boundary.
static void writeMimeBoundary(java.io.OutputStream outStream, java.lang.String boundary)
           
static void writeMM7Message(java.io.StringWriter writer, java.io.OutputStream outputStream, Attachments attachments, OMOutputFormat format, java.lang.String innerPartCID, java.lang.String innerBoundary)
          Pack all the attachments in to a multipart/related MIME part and attachs it as the second MIME Part of MIME message
static void writeSOAPWithAttachmentsMessage(java.io.StringWriter writer, java.io.OutputStream outputStream, Attachments attachments, OMOutputFormat format)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CRLF

private static byte[] CRLF
Constructor Detail

MIMEOutputUtils

public MIMEOutputUtils()
Method Detail

complete

public static void complete(java.io.OutputStream outStream,
                            java.lang.String bufferedXML,
                            java.util.LinkedList binaryNodeList,
                            java.lang.String boundary,
                            java.lang.String contentId,
                            java.lang.String charSetEncoding,
                            java.lang.String SOAPContentType)
Deprecated. is anyone really using this? Invoked by MTOMXMLStreamWriter to write the SOAP Part and the attachemts

Parameters:
outStream - OutputStream target
bufferedXML - String containing XML of SOAPPart
binaryNodeList - Text nodes with the attachment Data Handlers
boundary - Boundary String
contentId - Content-ID of SOAPPart
charSetEncoding - Character Encoding of SOAPPart
SOAPContentType - Content-Type of SOAPPart

complete

public static void complete(java.io.OutputStream outStream,
                            byte[] xmlData,
                            java.util.LinkedList binaryNodeList,
                            java.lang.String boundary,
                            java.lang.String contentId,
                            java.lang.String charSetEncoding,
                            java.lang.String SOAPContentType)
Invoked by MTOMXMLStreamWriter to write the SOAP Part and the attachements.

Parameters:
outStream - OutputStream target
bufferedXML - String containing XML of SOAPPart
binaryNodeList - Text nodes with the attachment Data Handlers
boundary - Boundary String
contentId - Content-ID of SOAPPart
charSetEncoding - Character Encoding of SOAPPart
SOAPContentType - Content-Type of SOAPPart

complete

public static void complete(java.io.OutputStream outStream,
                            java.io.StringWriter writer,
                            java.util.LinkedList binaryNodeList,
                            java.lang.String boundary,
                            java.lang.String contentId,
                            java.lang.String charSetEncoding,
                            java.lang.String SOAPContentType)
Deprecated. - is anyone really using this? Write the SOAPPart and attachments

Parameters:
outStream -
writer -
binaryNodeList -
boundary -
contentId -
charSetEncoding -
SOAPContentType -

createMimeBodyPart

public static javax.mail.internet.MimeBodyPart createMimeBodyPart(java.lang.String contentID,
                                                                  javax.activation.DataHandler dataHandler)
                                                           throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

writeMimeBoundary

public static void writeMimeBoundary(java.io.OutputStream outStream,
                                     java.lang.String boundary)
                              throws java.io.IOException
Throws:
java.io.IOException - This will write the boundary to output Stream

startWritingMime

public static void startWritingMime(java.io.OutputStream outStream,
                                    java.lang.String boundary)
                             throws java.io.IOException
Throws:
java.io.IOException - This will write the boundary with CRLF

writeBodyPart

public static void writeBodyPart(java.io.OutputStream outStream,
                                 javax.mail.internet.MimeBodyPart part,
                                 java.lang.String boundary)
                          throws java.io.IOException,
                                 javax.mail.MessagingException
Writes a CRLF for the earlier boundary then the BodyPart data with headers followed by boundary. Writes only the boundary. No more CRLF's are written after that.

Throws:
java.io.IOException
javax.mail.MessagingException

finishWritingMime

public static void finishWritingMime(java.io.OutputStream outStream)
                              throws java.io.IOException
Throws:
java.io.IOException - This will write "--" to the end of last boundary

writeSOAPWithAttachmentsMessage

public static void writeSOAPWithAttachmentsMessage(java.io.StringWriter writer,
                                                   java.io.OutputStream outputStream,
                                                   Attachments attachments,
                                                   OMOutputFormat format)

writeMM7Message

public static void writeMM7Message(java.io.StringWriter writer,
                                   java.io.OutputStream outputStream,
                                   Attachments attachments,
                                   OMOutputFormat format,
                                   java.lang.String innerPartCID,
                                   java.lang.String innerBoundary)
Pack all the attachments in to a multipart/related MIME part and attachs it as the second MIME Part of MIME message

Parameters:
writer -
outputStream -
attachments -
format -
innerBoundary -