|
talx x1.0.5 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objecttalx.util.MessageUtils
Contains static methods for message attachment processing.
| Nested Class Summary | |
static class |
MessageUtils.ByteArrayDataSource
|
| Method Summary | |
static javax.mail.internet.MimeMessage |
combine(javax.mail.internet.MimeMessage[] messages)
Combines the list of messages into a single multipart message. |
static javax.mail.internet.MimeMessage |
copy(javax.mail.internet.MimeMessage message)
Copies the given message into a new message object. |
static javax.mail.internet.MimeMessage |
createMessage(java.lang.String[] toAddresses,
java.lang.String[] toNames,
java.lang.String fromAddress,
java.lang.String fromName,
java.lang.String subject,
java.lang.Object body)
Returns a MimeMessage from the given address, to the given address with the given subject and body. |
static javax.mail.internet.MimeMessage |
createMessage(java.lang.String toAddress,
java.lang.String toName,
java.lang.String fromAddress,
java.lang.String fromName,
java.lang.String subject,
java.lang.Object body)
Returns a MimeMessage from the given address, to the given address with the given subject and body. |
static javax.mail.internet.MimePart[] |
getFiles(javax.mail.internet.MimeMessage m)
Returns the file attachments of a message. |
static java.awt.Image[] |
getImages(javax.mail.internet.MimeMessage m)
Extracts images from a message, if present. |
static java.lang.String |
getInlineText(javax.mail.internet.MimeMessage m)
Returns the concatenation of all the inline text parts of a message. |
static java.io.InputStream[] |
getMusic(javax.mail.internet.MimeMessage m)
Extracts images from a message, if present. |
static javax.mail.internet.MimePart[] |
getParts(javax.mail.internet.MimeMessage m,
java.lang.String contentDescription)
Returns the portions of a message matching the given content description. |
static java.io.InputStream[] |
getSounds(javax.mail.internet.MimeMessage m)
Extracts images from a message, if present. |
static java.lang.String[][] |
getText(javax.mail.internet.MimeMessage m)
Returns the text parts of a message. |
static boolean |
isAdminReport(javax.mail.internet.MimeMessage m)
Returns true if the message is a multipart/report type. |
static boolean |
isRenderable(javax.mail.internet.MimeMessage m)
Returns true if the message contains only parts that are recognized by this system. |
static boolean |
sendCPISCommand(java.security.PrivateKey key,
java.lang.String toName,
java.lang.String toAddress,
java.lang.String fromName,
java.lang.String fromAddress,
java.lang.String command,
java.lang.String restart,
java.lang.String context,
java.sql.ResultSet files,
java.lang.String subjectLine)
Sends a CPIS command from the server to the client. |
static java.lang.String[] |
splitAddress(java.lang.String address,
boolean raw)
Returns username and major subdomain from given address. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static javax.mail.internet.MimeMessage createMessage(java.lang.String[] toAddresses,
java.lang.String[] toNames,
java.lang.String fromAddress,
java.lang.String fromName,
java.lang.String subject,
java.lang.Object body)
throws javax.mail.MessagingException
Important Note: This method does not call the saveChanges method on the newly constructed message. Thus, the calling program can continue to add more headers. However, this also means that the calling program must call saveChanges before attempting to send the message.
toAddresses - the list of valid, parseable email addresses to send the
message to. None of these can be null.toNames - the list of personal names corresponding to the entries of
toAddresses. These can be null and the length can be less than the length
of toAddresses. Thus, if none of the personal names are know, this can be
a zero-length array. If certain names are unknown, those entries in the
array can be null.fromAddress - a parseable address that the message is from.fromName - the personal name that the message is from.subject - the subject header for the message. If null, the subject is
not set. If the empty string, then the subject is set to blank.body - the body of the message. If this is a CharSequence or number,
the resulting message body will be the result of the toString method for the
object. If this is a MimeMultiPart,
For other types of object, the body will be constructed from an
ObjectDataSource object constructed with the object.
javax.mail.MessagingException - if the message cannot be constructed, including
problems parsing the to and from addresses, and obtaining a valid data handler.
The valid types of Object for the body are:java.lang.NullPointerException - if any entries of toAddresses are null.
public static javax.mail.internet.MimeMessage createMessage(java.lang.String toAddress,
java.lang.String toName,
java.lang.String fromAddress,
java.lang.String fromName,
java.lang.String subject,
java.lang.Object body)
throws javax.mail.MessagingException
javax.mail.MessagingException
public static java.lang.String[] splitAddress(java.lang.String address,
boolean raw)
address - the address string to parse.raw - if true, the address is interpreted as a Mime address header,
otherwise, it is assumed to have the form someone@somewhere.
Note that Mime address strings can have the form
someusername@sub.domain.dom (personal name)
or personal name <someusername@sub.domain.dom>
if raw is true, this method will attempt to remove the personal
name before proceeding.
public static boolean isAdminReport(javax.mail.internet.MimeMessage m)
public static boolean isRenderable(javax.mail.internet.MimeMessage m)
public static java.awt.Image[] getImages(javax.mail.internet.MimeMessage m)
throws javax.mail.MessagingException
m - the message containing an image.
javax.mail.MessagingException
public static java.io.InputStream[] getSounds(javax.mail.internet.MimeMessage m)
throws javax.mail.MessagingException
m - the message containing an image.
javax.mail.MessagingException
public static java.io.InputStream[] getMusic(javax.mail.internet.MimeMessage m)
throws javax.mail.MessagingException
m - the message containing an image.
javax.mail.MessagingException
public static javax.mail.internet.MimePart[] getParts(javax.mail.internet.MimeMessage m,
java.lang.String contentDescription)
throws javax.mail.MessagingException
m - the message to searchcontentDescription - the content description to match, or null.
javax.mail.MessagingException
public static javax.mail.internet.MimePart[] getFiles(javax.mail.internet.MimeMessage m)
throws javax.mail.MessagingException
javax.mail.MessagingException
public static java.lang.String[][] getText(javax.mail.internet.MimeMessage m)
throws javax.mail.MessagingException
javax.mail.MessagingException
public static java.lang.String getInlineText(javax.mail.internet.MimeMessage m)
throws javax.mail.MessagingException
javax.mail.MessagingException
public static javax.mail.internet.MimeMessage combine(javax.mail.internet.MimeMessage[] messages)
throws javax.mail.MessagingException
java.lang.NullPointerException - if the first message is null. Other
nulls in the list will not result in an exception being thrown.
javax.mail.MessagingException
public static javax.mail.internet.MimeMessage copy(javax.mail.internet.MimeMessage message)
throws javax.mail.MessagingException
java.lang.NullPointerException - if the message is null.
javax.mail.MessagingException
public static boolean sendCPISCommand(java.security.PrivateKey key,
java.lang.String toName,
java.lang.String toAddress,
java.lang.String fromName,
java.lang.String fromAddress,
java.lang.String command,
java.lang.String restart,
java.lang.String context,
java.sql.ResultSet files,
java.lang.String subjectLine)
ServletException - if a messaging exception is encountered.
|
talx x1.0.5 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.