|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.mail.MailUtils
public class MailUtils
Nested Class Summary | |
---|---|
static class |
MailUtils.Attachment
Very simple representation of a mail attachment after it has been extracted from a message. |
Constructor Summary | |
---|---|
MailUtils()
|
Method Summary | |
---|---|
static javax.mail.internet.MimeBodyPart |
createAttachmentMimeBodyPart(java.lang.String path)
Produces a mimebodypart object from an attachment file path. |
static javax.mail.internet.MimeBodyPart |
createZippedAttachmentMimeBodyPart(java.lang.String path)
|
static MailUtils.Attachment[] |
getAttachments(javax.mail.Message message)
Gets all parts of a message that are attachments rather than alternative inline bits. |
static com.opensymphony.user.User |
getAuthorFromSender(javax.mail.Message message)
Deprecated. Now incorporated into JIRA due to app-specific logic, will be removed in a future release. (complain to chris@atlassian.com) |
static java.lang.String |
getBody(javax.mail.Message message)
Get the body of the message as a String. |
static com.opensymphony.user.User |
getFirstValidUser(javax.mail.Address[] addresses)
Deprecated. Now incorporated into JIRA due to app-specific logic, will be removed in a future release. (complain to chris@atlassian.com) |
static java.util.List |
getSenders(javax.mail.Message message)
Returns a List |
static boolean |
hasRecipient(java.lang.String matchEmail,
javax.mail.Message message)
|
static javax.mail.internet.InternetAddress[] |
parseAddresses(java.lang.String addresses)
Parse addresses from a comma (and space) separated string into the proper array |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MailUtils()
Method Detail |
---|
public static javax.mail.internet.InternetAddress[] parseAddresses(java.lang.String addresses) throws javax.mail.internet.AddressException
javax.mail.internet.AddressException
public static java.lang.String getBody(javax.mail.Message message) throws javax.mail.MessagingException
Note: If the message contains nested multipart parts, an HTML part nested at a higher level will take precedence over a text part nested deeper.
message
- The message to retrieve the body from
javax.mail.MessagingException
- If there was an error getting the content from the messagepublic static MailUtils.Attachment[] getAttachments(javax.mail.Message message) throws javax.mail.MessagingException, java.io.IOException
message
- the message from which to extract the attachments
javax.mail.MessagingException
java.io.IOException
public static com.opensymphony.user.User getAuthorFromSender(javax.mail.Message message) throws javax.mail.MessagingException
message
- The message to get the author from.
javax.mail.MessagingException
- If an error occurred getting the message authorpublic static com.opensymphony.user.User getFirstValidUser(javax.mail.Address[] addresses)
addresses
- addresses to be used to search for a User.
public static boolean hasRecipient(java.lang.String matchEmail, javax.mail.Message message) throws javax.mail.MessagingException
javax.mail.MessagingException
public static java.util.List getSenders(javax.mail.Message message) throws javax.mail.MessagingException
message
- the message from which to get senders.
javax.mail.MessagingException
- if the senders can't be retrieved from message.public static javax.mail.internet.MimeBodyPart createAttachmentMimeBodyPart(java.lang.String path) throws javax.mail.MessagingException
path
-
javax.mail.MessagingException
public static javax.mail.internet.MimeBodyPart createZippedAttachmentMimeBodyPart(java.lang.String path) throws javax.mail.MessagingException
javax.mail.MessagingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |