|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.james.core.MimeMessageUtil
public class MimeMessageUtil
Utility class to provide optimized write methods for the various MimeMessage implementations.
Constructor Summary | |
---|---|
MimeMessageUtil()
|
Method Summary | |
---|---|
static long |
calculateMessageSize(javax.mail.internet.MimeMessage message)
Calculate the size of the give mimeMessage |
static void |
copyStream(java.io.InputStream in,
java.io.OutputStream out)
Convenience method to copy streams |
static java.io.InputStream |
getHeadersInputStream(javax.mail.internet.MimeMessage message,
java.lang.String[] ignoreList)
Get an InputStream which holds all headers of the given MimeMessage |
static long |
getMessageSize(javax.mail.internet.MimeMessage message)
Return the full site of an mimeMessage |
static void |
writeHeadersTo(java.util.Enumeration headers,
java.io.OutputStream headerOs)
Write the message headers to the given outputstream |
static void |
writeMessageBodyTo(javax.mail.internet.MimeMessage message,
java.io.OutputStream bodyOs)
Write message body of given mimeessage to the given outputStream |
static void |
writeTo(javax.mail.internet.MimeMessage message,
java.io.OutputStream headerOs,
java.io.OutputStream bodyOs)
Convenience method to take any MimeMessage and write the headers and body to two different output streams |
static void |
writeTo(javax.mail.internet.MimeMessage message,
java.io.OutputStream headerOs,
java.io.OutputStream bodyOs,
java.lang.String[] ignoreList)
Convenience method to take any MimeMessage and write the headers and body to two different output streams, with an ignore list |
static void |
writeToInternal(javax.mail.internet.MimeMessage message,
java.io.OutputStream headerOs,
java.io.OutputStream bodyOs,
java.lang.String[] ignoreList)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MimeMessageUtil()
Method Detail |
---|
public static void writeTo(javax.mail.internet.MimeMessage message, java.io.OutputStream headerOs, java.io.OutputStream bodyOs) throws java.io.IOException, javax.mail.MessagingException
message
- the MimeMessage reading fromheaderOs
- the OutputStream writting the headers tobodyOs
- the OutputStream writting the body to
java.io.IOException
- get thrown if an IO Error detected while writing to the streams
javax.mail.MessagingException
- get thrown if an error detected while reading the messagepublic static void writeTo(javax.mail.internet.MimeMessage message, java.io.OutputStream headerOs, java.io.OutputStream bodyOs, java.lang.String[] ignoreList) throws java.io.IOException, javax.mail.MessagingException
message
- the MimeMessage reading fromheaderOs
- the OutputStream writting the headers tobodyOs
- the OutputStream writting the body toignoreList
- the String[] which contains headers which should be ignored
java.io.IOException
- get thrown if an IO Error detected while writing to the streams
javax.mail.MessagingException
- get thrown if an error detected while reading the messagepublic static void writeToInternal(javax.mail.internet.MimeMessage message, java.io.OutputStream headerOs, java.io.OutputStream bodyOs, java.lang.String[] ignoreList) throws javax.mail.MessagingException, java.io.IOException, javax.activation.UnsupportedDataTypeException
message
- headerOs
- bodyOs
- ignoreList
-
javax.mail.MessagingException
java.io.IOException
javax.activation.UnsupportedDataTypeException
public static void writeMessageBodyTo(javax.mail.internet.MimeMessage message, java.io.OutputStream bodyOs) throws java.io.IOException, javax.activation.UnsupportedDataTypeException, javax.mail.MessagingException
message
- the MimeMessage used as inputbodyOs
- the OutputStream to write the message body to
java.io.IOException
javax.activation.UnsupportedDataTypeException
javax.mail.MessagingException
public static void copyStream(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
in
- the InputStream used as copy sourceout
- the OutputStram used as copy destination
java.io.IOException
public static void writeHeadersTo(java.util.Enumeration headers, java.io.OutputStream headerOs) throws javax.mail.MessagingException
headers
- the Enumeration which holds the headersheaderOs
- the OutputStream to which the headers get written
javax.mail.MessagingException
public static java.io.InputStream getHeadersInputStream(javax.mail.internet.MimeMessage message, java.lang.String[] ignoreList) throws javax.mail.MessagingException
message
- the MimeMessage used as sourceignoreList
- the String[] which holds headers which should be ignored
javax.mail.MessagingException
public static long getMessageSize(javax.mail.internet.MimeMessage message) throws javax.mail.MessagingException
javax.mail.MessagingException
- if a problem occours while computing the message sizepublic static long calculateMessageSize(javax.mail.internet.MimeMessage message) throws javax.mail.MessagingException
message
- the MimeMessage
javax.mail.MessagingException
- if a problem occours while calculate the message size
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |