public class MimeMessageUtil extends Object
Constructor and Description |
---|
MimeMessageUtil() |
Modifier and Type | Method and Description |
---|---|
static long |
calculateMessageSize(javax.mail.internet.MimeMessage message)
Calculate the size of the give mimeMessage
|
static InputStream |
getHeadersInputStream(javax.mail.internet.MimeMessage message,
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(Enumeration headers,
OutputStream headerOs)
Write the message headers to the given outputstream
|
static void |
writeMessageBodyTo(javax.mail.internet.MimeMessage message,
OutputStream bodyOs)
Write message body of given mimeessage to the given outputStream
|
static void |
writeTo(javax.mail.internet.MimeMessage message,
OutputStream headerOs,
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,
OutputStream headerOs,
OutputStream bodyOs,
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,
OutputStream headerOs,
OutputStream bodyOs,
String[] ignoreList) |
public static void writeTo(javax.mail.internet.MimeMessage message, OutputStream headerOs, OutputStream bodyOs) throws IOException, javax.mail.MessagingException
message
- the MimeMessage reading fromheaderOs
- the OutputStream writting the headers tobodyOs
- the OutputStream writting the body toIOException
- get thrown if an IO Error detected while writing to the
streamsjavax.mail.MessagingException
- get thrown if an error detected while reading the messagepublic static void writeTo(javax.mail.internet.MimeMessage message, OutputStream headerOs, OutputStream bodyOs, String[] ignoreList) throws 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 ignoredIOException
- get thrown if an IO Error detected while writing to the
streamsjavax.mail.MessagingException
- get thrown if an error detected while reading the messagepublic static void writeToInternal(javax.mail.internet.MimeMessage message, OutputStream headerOs, OutputStream bodyOs, String[] ignoreList) throws javax.mail.MessagingException, IOException, UnsupportedDataTypeException
message
- headerOs
- bodyOs
- ignoreList
- javax.mail.MessagingException
IOException
UnsupportedDataTypeException
public static void writeMessageBodyTo(javax.mail.internet.MimeMessage message, OutputStream bodyOs) throws IOException, UnsupportedDataTypeException, javax.mail.MessagingException
message
- the MimeMessage used as inputbodyOs
- the OutputStream to write the message body toIOException
UnsupportedDataTypeException
javax.mail.MessagingException
public static void writeHeadersTo(Enumeration headers, OutputStream headerOs) throws javax.mail.MessagingException
headers
- the Enumeration which holds the headersheaderOs
- the OutputStream to which the headers get writtenjavax.mail.MessagingException
public static InputStream getHeadersInputStream(javax.mail.internet.MimeMessage message, String[] ignoreList) throws javax.mail.MessagingException
message
- the MimeMessage used as sourceignoreList
- the String[] which holds headers which should be ignoredjavax.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 MimeMessagejavax.mail.MessagingException
- if a problem occours while calculate the message sizeCopyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.