|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MultipartWriter
Writes a MIME multipart package as used by XOP/MTOM and SOAP with Attachments.
Objects implementing this interface are created using a MultipartWriterFactory. MIME
parts are written using writePart(String, String, String) or
writePart(DataHandler, String, String). Calls to both methods can be mixed, i.e. it
is not required to use the same method for all MIME parts. Instead, the caller should choose
the most convenient method for each part (depending on the form in which the content is
available). After all parts have been written, complete() must be called to write the
final MIME boundary.
The following semantics are defined for the contentTransferEncoding and
contentID arguments of the two write methods:
contentTransferEncoding argument. The caller only
provides the unencoded data. The implementation should support at least binary
and base64. If it doesn't support the specified encoding, it may use an
alternative one. In any case, the implementation must make sure that the MIME part
has a Content-Transfer-Encoding header appropriate for the applied
encoding.
| Method Summary | |
|---|---|
void |
complete()
Complete writing of the MIME multipart package. |
void |
writePart(javax.activation.DataHandler dataHandler,
java.lang.String contentTransferEncoding,
java.lang.String contentID)
Write a MIME part. |
java.io.OutputStream |
writePart(java.lang.String contentType,
java.lang.String contentTransferEncoding,
java.lang.String contentID)
Start writing a MIME part. |
| Method Detail |
|---|
java.io.OutputStream writePart(java.lang.String contentType,
java.lang.String contentTransferEncoding,
java.lang.String contentID)
throws java.io.IOException
OutputStream that the caller can
use to write the content of the MIME part. After writing the content,
OutputStream.close() must be called to complete the writing of the MIME part.
contentType - the value of the Content-Type header of the MIME partcontentTransferEncoding - the content transfer encoding to be used (see above); must not be
nullcontentID - the content ID of the MIME part (see above)
java.io.IOException - if an I/O error occurs when writing to the underlying stream
void writePart(javax.activation.DataHandler dataHandler,
java.lang.String contentTransferEncoding,
java.lang.String contentID)
throws java.io.IOException
DataHandler object, which also
specifies the content type of the part.
dataHandler - the content of the MIME part to writecontentTransferEncoding - the content transfer encoding to be used (see above); must not be
nullcontentID - the content ID of the MIME part (see above)
java.io.IOException - if an I/O error occurs when writing the part to the underlying stream
void complete()
throws java.io.IOException
java.io.IOException - if an I/O error occurs when writing to the underlying stream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||