com.atlassian.confluence.it.mail
Class MailUtils

java.lang.Object
  extended by com.atlassian.confluence.it.mail.MailUtils

public class MailUtils
extends Object

Static methods for interacting with email messages.

Since:
v4.2

Constructor Summary
MailUtils()
           
 
Method Summary
static String getBody(javax.mail.internet.MimeMessage smtpMessage)
           
static Document getDocument(javax.mail.internet.MimeMessage message)
           
static String getFirstRecipient(javax.mail.internet.MimeMessage smtpMessage)
           
static List<SimpleLink> getFooterLinks(javax.mail.internet.MimeMessage message)
           
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 SimpleLinks.
static SimpleLink getLinkWithId(javax.mail.internet.MimeMessage message, String id)
          Locates a link with the specified id and returns it as a SimpleLink.
static String getPrefixedSubject(String subject)
           
static String getSender(javax.mail.internet.MimeMessage smtpMessage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailUtils

public MailUtils()
Method Detail

getPrefixedSubject

public static String getPrefixedSubject(String subject)

getBody

public static String getBody(javax.mail.internet.MimeMessage smtpMessage)

getFirstRecipient

public static String getFirstRecipient(javax.mail.internet.MimeMessage smtpMessage)

getSender

public static String getSender(javax.mail.internet.MimeMessage smtpMessage)
                        throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException

getLinksInElementWithId

public 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 SimpleLinks. Will fail with a null-pointer exception if no matching node is found.

Parameters:
message - the mime message
id - the id to search for links within
Returns:
a list of SimpleLink objects

getFooterLinks

public static List<SimpleLink> getFooterLinks(javax.mail.internet.MimeMessage message)

getLinkWithId

public static SimpleLink getLinkWithId(javax.mail.internet.MimeMessage message,
                                       String id)
Locates a link with the specified id and returns it as a SimpleLink. Will fail with a null-pointer exception if no matching node is found.

Parameters:
message - the mime message to search within
id - the id of the link to return
Returns:
a SimpleLink object

getDocument

public static Document getDocument(javax.mail.internet.MimeMessage message)


Copyright © 2003-2013 Atlassian. All Rights Reserved.