public class MailUtils extends Object
Constructor and Description |
---|
MailUtils() |
Modifier and Type | Method and Description |
---|---|
static javax.mail.internet.MimeMessage |
extractFirstEmailAddressedTo(User user,
List<javax.mail.internet.MimeMessage> allMessages) |
static Collection<javax.mail.internet.MimeMessage> |
filterBySubject(Collection<javax.mail.internet.MimeMessage> messages,
String subject) |
static String |
getBody(javax.mail.internet.MimeMessage smtpMessage) |
static Document |
getDocument(javax.mail.internet.MimeMessage message) |
static Iterable<javax.mail.internet.MimeMessage> |
getEmailAddressedToUser(User user,
List<javax.mail.internet.MimeMessage> allMessages) |
static String |
getFirstRecipient(javax.mail.internet.MimeMessage smtpMessage) |
static List<SimpleLink> |
getFooterLinks(javax.mail.internet.MimeMessage message,
String footerId) |
static List<SimpleLink> |
getLinksInElementWithId(javax.mail.internet.MimeMessage message,
String id)
Locates all links inside a container with the specified id and returns them as an
ordered list of
SimpleLink s. |
static SimpleLink |
getLinkWithId(javax.mail.internet.MimeMessage message,
String id)
Locates a link with the specified id and returns it as a
SimpleLink . |
static SimpleLink |
getLinkWithText(javax.mail.internet.MimeMessage message,
String linkText)
Returns the first link that matches the provided link text
|
static String |
getPrefixedSubject(String subject) |
static String |
getSender(javax.mail.internet.MimeMessage smtpMessage) |
static JSoupTester |
getSoup(javax.mail.internet.MimeMessage message)
JSoup for you! Ask Fabian why this is better than using a DOM, or the plain text of the message body :)
|
static com.google.common.base.Function<javax.mail.internet.MimeMessage,String> |
toDiagnosticString() |
static String |
toDiagnosticString(javax.mail.internet.MimeMessage mimeMessage) |
public static String getBody(javax.mail.internet.MimeMessage smtpMessage)
public static String getFirstRecipient(javax.mail.internet.MimeMessage smtpMessage)
public static String getSender(javax.mail.internet.MimeMessage smtpMessage) throws javax.mail.MessagingException
javax.mail.MessagingException
public static List<SimpleLink> getLinksInElementWithId(javax.mail.internet.MimeMessage message, String id)
SimpleLink
s.
Will fail with a null-pointer exception if no matching node is found.message
- the mime messageid
- the id to search for links withinpublic static List<SimpleLink> getFooterLinks(javax.mail.internet.MimeMessage message, String footerId)
public static SimpleLink getLinkWithId(javax.mail.internet.MimeMessage message, String id)
SimpleLink
.
Will fail with a null-pointer exception if no matching node is found.
) content;
}message
- the mime message to search withinid
- the id of the link to returnpublic static SimpleLink getLinkWithText(javax.mail.internet.MimeMessage message, String linkText)
message
- the mime message to search withinlinkText
- the text of the link to match against to determine which link to returnpublic static JSoupTester getSoup(javax.mail.internet.MimeMessage message)
message
- the message to get the HTML body frompublic static Document getDocument(javax.mail.internet.MimeMessage message)
public static Iterable<javax.mail.internet.MimeMessage> getEmailAddressedToUser(User user, List<javax.mail.internet.MimeMessage> allMessages)
public static com.google.common.base.Function<javax.mail.internet.MimeMessage,String> toDiagnosticString()
public static String toDiagnosticString(javax.mail.internet.MimeMessage mimeMessage) throws javax.mail.MessagingException
javax.mail.MessagingException
public static javax.mail.internet.MimeMessage extractFirstEmailAddressedTo(User user, List<javax.mail.internet.MimeMessage> allMessages)
public static Collection<javax.mail.internet.MimeMessage> filterBySubject(Collection<javax.mail.internet.MimeMessage> messages, String subject)
Copyright © 2003–2018 Atlassian. All rights reserved.