|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.utils.MessageUtility
public final class MessageUtility
MessageUtility - Provides various helper methods for message processing.
| Method Summary | |
|---|---|
static java.lang.String |
checkCharset(MailPart p,
ContentType ct)
Gets a valid charset-encoding for specified textual part; meaning its content type matches text/*. |
static java.lang.String |
checkCharset(javax.mail.Part p,
ContentType ct)
Gets a valid charset-encoding for specified textual part; meaning its content type matches text/*. |
static java.io.InputStream |
getPartInputStream(javax.mail.Part p)
Gets the input stream of specified part. |
static java.lang.String |
readMailPart(MailPart mailPart,
java.lang.String charset)
Reads the stream content from given mail part. |
static java.lang.String |
readMimePart(javax.mail.Part p,
ContentType ct)
Reads the string out of MIME part's input stream. |
static java.lang.String |
readMimePart(javax.mail.Part p,
java.lang.String charset)
Reads the string out of MIME part's input stream. |
static java.lang.String |
readStream(java.io.InputStream inStream,
java.lang.String charset)
Reads a string from given input stream using direct buffering. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String checkCharset(MailPart p,
ContentType ct)
throws MailException
text/*.
p - The part to detect a charset forct - The part's content type
MailException - If part's input stream cannot be obtained
public static java.lang.String checkCharset(javax.mail.Part p,
ContentType ct)
text/*.
p - The part to detect a charset forct - The part's content type
public static java.io.InputStream getPartInputStream(javax.mail.Part p)
p - The part whose input stream shall be returned
public static java.lang.String readMimePart(javax.mail.Part p,
ContentType ct)
throws javax.mail.MessagingException
javax.mail.Part.getInputStream() is used. If an I/O error occurs (java.io.IOException) then the next try is
with part's raw input stream. If everything fails an empty string is returned.
p - The javax.mail.Part objectct - The part's content type
javax.mail.MessagingException - If an error occurs in part's getter methods
public static java.lang.String readMimePart(javax.mail.Part p,
java.lang.String charset)
throws javax.mail.MessagingException
javax.mail.Part.getInputStream() is used. If an I/O error occurs (java.io.IOException) then the next try is
with part's raw input stream. If everything fails an empty string is returned.
p - The javax.mail.Part objectcharset - The charset
javax.mail.MessagingException - If an error occurs in part's getter methods
public static java.lang.String readMailPart(MailPart mailPart,
java.lang.String charset)
throws java.io.IOException,
MailException
mailPart - The mail partcharset - The charset encoding used to generate a String object from raw bytes
String read from mail part's stream
java.io.IOException
MailException
public static java.lang.String readStream(java.io.InputStream inStream,
java.lang.String charset)
throws java.io.IOException
inStream - The input streamcharset - The charset
String read from input stream
java.io.IOException - If an I/O error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||