public class MimeWriter extends MimeHelper implements IStreamWriter
| Modifier and Type | Class and Description |
|---|---|
static class |
MimeWriter.eMimeSubType |
log, markSize, theMultipart| Constructor and Description |
|---|
MimeWriter() |
MimeWriter(MimeWriter.eMimeSubType subtype) |
MimeWriter(javax.mail.Multipart mp) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBodyPart(BodyPartHelper bph) |
void |
buildMimePackage(JDFDoc docJMF,
XMLDoc docJDF,
boolean extendReferenced)
build a MIME package that contains all references in all FileSpecs of a given JDFDoc the doc is modified so that all URLs are cids
|
void |
buildMimePackage(java.util.Vector<? extends XMLDoc> vXMLDocs)
Builds a MIME package.
|
void |
createMimePackage()
build an empty MIME package
|
java.io.InputStream |
getInputStream()
gets an input s
|
void |
setMIMEDetails(MimeUtil.MIMEDetails _md) |
BodyPartHelper |
updateMultipart(java.io.InputStream is,
java.lang.String cid,
java.lang.String contentType) |
javax.mail.BodyPart |
updateXMLMultipart(XMLDoc xmlDoc,
java.lang.String cid) |
void |
writeStream(java.io.OutputStream os)
write myself to a stream
|
void |
writeToDir(java.io.File directory)
write a Message to a directory
|
java.io.File |
writeToFile(java.lang.String fileName)
write a Multipart to an output file
|
JDFDoc |
writeToQueue(JDFDoc docJMF,
JDFDoc docJDF,
java.lang.String strUrl)
submit a multipart file to a queue
|
void |
writeToStream(java.io.OutputStream outStream)
write a Multipart to a Stream
|
UrlPart |
writeToURL(java.lang.String strUrl)
write a Multipart to an output URL File: and http: are currently supported Use HttpURLConnection.getInputStream() to retrieve the http response
|
getBodyPartHelper, getBodyParts, getCount, getCreatePartByCID, getCreatePartByLocalName, getMarkSize, getMultiPart, getPartByCID, getPartHelperByAttribute, getPartHelperByCID, getPartHelperByLocalName, setMarkSizepublic MimeWriter()
public MimeWriter(MimeWriter.eMimeSubType subtype)
public MimeWriter(javax.mail.Multipart mp)
mp - public void setMIMEDetails(MimeUtil.MIMEDetails _md)
_md - public java.io.InputStream getInputStream()
throws java.io.IOException,
javax.mail.MessagingException
java.io.IOExceptionjavax.mail.MessagingExceptionpublic void createMimePackage()
public BodyPartHelper updateMultipart(java.io.InputStream is, java.lang.String cid, java.lang.String contentType)
is - cid - contentType - public javax.mail.BodyPart updateXMLMultipart(XMLDoc xmlDoc, java.lang.String cid)
xmlDoc - cid - public java.io.File writeToFile(java.lang.String fileName)
fileName - the file namepublic void writeToDir(java.io.File directory)
throws javax.mail.MessagingException,
java.io.IOException
directory - the directory to use as '.' for writing the mime partsjavax.mail.MessagingExceptionjava.io.IOExceptionjavax.mail.MessagingExceptionpublic void writeToStream(java.io.OutputStream outStream)
throws java.io.IOException,
javax.mail.MessagingException
outStream - the existing output stream, note that a buffered output stream is created in case outStream is unbufferedjava.io.IOExceptionjavax.mail.MessagingExceptionpublic UrlPart writeToURL(java.lang.String strUrl) throws java.io.IOException, javax.mail.MessagingException
strUrl - the URL to write toHttpURLConnection the opened http connection, null in case of error or filejava.io.IOExceptionjavax.mail.MessagingExceptionpublic void buildMimePackage(java.util.Vector<? extends XMLDoc> vXMLDocs)
vXMLDocs - the Vector of XMLDoc representing the JMF and JDFs to be stored as the first part of the package tpublic void buildMimePackage(JDFDoc docJMF, XMLDoc docJDF, boolean extendReferenced)
docJMF - the JDFDoc representation of the JMF that references the jdf to package, if null only the jdf is packaged note that the URL of docJDF must already be specified as a CIDdocJDF - the JDFDoc representation of the JDF to packageextendReferenced - if true, also package any further reeferenced filespublic void addBodyPart(BodyPartHelper bph)
bph - public JDFDoc writeToQueue(JDFDoc docJMF, JDFDoc docJDF, java.lang.String strUrl) throws java.io.IOException, javax.mail.MessagingException
docJMF - the jmf document containing the submitqueueentry or resubmitqueueentrydocJDF - the jdf to submitstrUrl - the url to submit tojava.io.IOExceptionjavax.mail.MessagingExceptionpublic void writeStream(java.io.OutputStream os)
throws java.io.IOException
IStreamWriterwriteStream in interface IStreamWriteros - the output streamjava.io.IOException - if io snafu...