public class OMMultipartWriter extends Object
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 and Description |
---|
OMMultipartWriter(OutputStream out,
OMOutputFormat format) |
Modifier and Type | Method and Description |
---|---|
void |
complete()
Complete writing of the MIME multipart package.
|
String |
getRootPartContentType()
Get the content type of the root part, as determined by the
OMOutputFormat passed
to the constructor of this object. |
void |
writePart(javax.activation.DataHandler dataHandler,
String contentID)
Write a MIME part.
|
OutputStream |
writePart(String contentType,
String contentID)
Start writing an attachment part of the MIME package.
|
OutputStream |
writeRootPart()
Start writing the root part of the MIME package.
|
public OMMultipartWriter(OutputStream out, OMOutputFormat format)
public String getRootPartContentType()
OMOutputFormat
passed
to the constructor of this object.public OutputStream writeRootPart() throws IOException
MultipartWriter.writePart(String, String, String)
, but computes the content type,
content transfer encoding and content ID from the OMOutputFormat
.IOException
- if an I/O error occurs when writing to the underlying streampublic OutputStream writePart(String contentType, String contentID) throws IOException
MultipartWriter.writePart(String, String, String)
, but computes the content transfer
encoding based on the content type and the OMOutputFormat
.contentType
- the content type of the MIME part to writecontentID
- the content ID of the MIME partIOException
- if an I/O error occurs when writing to the underlying streampublic void writePart(javax.activation.DataHandler dataHandler, String contentID) throws IOException
MultipartWriter.writePart(DataHandler, String, String)
, but computes the appropriate
content transfer encoding from the OMOutputFormat
.dataHandler
- the content of the MIME part to writecontentID
- the content ID of the MIME partIOException
- if an I/O error occurs when writing the part to the underlying streampublic void complete() throws IOException
MultipartWriter.complete()
.IOException
- if an I/O error occurs when writing to the underlying streamCopyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.