Package org.apache.axiom.om.impl
Class OMMultipartWriter
java.lang.Object
org.apache.axiom.om.impl.OMMultipartWriter
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcomplete()Complete writing of the MIME multipart package.Get the content type of the root part, as determined by theOMOutputFormatpassed to the constructor of this object.Start writing an attachment part of the MIME package.voidwritePart(DataHandler dataHandler, String contentID) Write a MIME part.voidwritePart(DataHandler dataHandler, String contentID, List<String> extraHeaders) Write a MIME part.Start writing the root part of the MIME package.
-
Constructor Details
-
OMMultipartWriter
-
-
Method Details
-
getRootPartContentType
Get the content type of the root part, as determined by theOMOutputFormatpassed to the constructor of this object.- Returns:
- the content type of the root part
-
writeRootPart
Start writing the root part of the MIME package. This method delegates toMultipartWriter.writePart(String, String, String), but computes the content type, content transfer encoding and content ID from theOMOutputFormat.- 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
Start writing an attachment part of the MIME package. This method delegates toMultipartWriter.writePart(String, String, String), but computes the content transfer encoding based on the content type and theOMOutputFormat.- Parameters:
contentType- the content type of the MIME part to writecontentID- the content ID of the MIME part- 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
Write a MIME part. This method delegates toMultipartWriter.writePart(DataHandler, String, String), but computes the appropriate content transfer encoding from theOMOutputFormat.- Parameters:
dataHandler- the content of the MIME part to writecontentID- the content ID of the MIME part- Throws:
IOException- if an I/O error occurs when writing the part to the underlying stream
-
writePart
public void writePart(DataHandler dataHandler, String contentID, List<String> extraHeaders) throws IOException Write a MIME part. This method delegates toMultipartWriter.writePart(DataHandler, String, String), but computes the appropriate content transfer encoding from theOMOutputFormat.- Parameters:
dataHandler- the content of the MIME part to writecontentID- the content ID of the MIME partextraHeaders- extraheaders for MIME part- Throws:
IOException- if an I/O error occurs when writing the part to the underlying stream
-
complete
Complete writing of the MIME multipart package. This method delegates toMultipartWriter.complete().- Throws:
IOException- if an I/O error occurs when writing to the underlying stream
-