org.apache.axiom.om.impl
Class OMMultipartWriter

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

public class OMMultipartWriter
extends Object

Writes a MIME multipart package as used by XOP/MTOM and SOAP with Attachments. This class wraps a MultipartWriter, providing a higher level API. In particular it will configure content types and content transfer encodings based on information from an OMOutputFormat object.


Constructor Summary
OMMultipartWriter(OutputStream out, OMOutputFormat format)
           
 
Method Summary
 void complete()
          Complete writing of the MIME multipart package.
 void writePart(DataHandler dataHandler, String contentID)
          Write a MIME part.
 OutputStream writeRootPart()
          Start writing the root part of the MIME package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OMMultipartWriter

public OMMultipartWriter(OutputStream out,
                         OMOutputFormat format)
Method Detail

writeRootPart

public OutputStream writeRootPart()
                           throws IOException
Start writing the root part of the MIME package. This method delegates to MultipartWriter.writePart(String, String, String), but computes the content type, content transfer encoding and content ID from the OMOutputFormat.

Returns:
an output stream to write the content of the MIME part
Throws:
IOException - if an I/O error occurs when writing to the underlying stream

writePart

public void writePart(DataHandler dataHandler,
                      String contentID)
               throws IOException
Write a MIME part. This method delegates to MultipartWriter.writePart(DataHandler, String, String), but computes the appropriate content transfer encoding from the OMOutputFormat.

Parameters:
dataHandler - the content of the MIME part to write
contentID - the content ID of the MIME part
Throws:
IOException - if an I/O error occurs when writing the part to the underlying stream

complete

public void complete()
              throws IOException
Complete writing of the MIME multipart package. This method delegates to MultipartWriter.complete().

Throws:
IOException - if an I/O error occurs when writing to the underlying stream


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.