com.liferay.portlet.mail.util
Class MailUtil

java.lang.Object
  extended bycom.liferay.portlet.mail.util.MailUtil

public class MailUtil
extends java.lang.Object

Used as a fascade to the JavaMail API. All JavaMail objects are wrappered in model classes and returned out of this utility fascade. View Source

Author:
Alexander Chow

Field Summary
static java.lang.String[] DEFAULT_FOLDERS
           
static java.lang.String MAIL_BOX_STYLE
           
static java.lang.String MAIL_DRAFTS_NAME
           
static java.lang.String MAIL_INBOX_NAME
           
static java.lang.String MAIL_SENT_NAME
           
static java.lang.String MAIL_SPAM_NAME
           
static java.lang.String MAIL_TRASH_NAME
           
 
Constructor Summary
MailUtil()
           
 
Method Summary
protected static void cleanUp(javax.servlet.http.HttpSession ses)
           
static void completeMessage(javax.servlet.http.HttpServletRequest req, MailMessage mailMessage, boolean send, java.lang.String originalId, boolean wasDraft)
           
static void createFolder(javax.servlet.http.HttpServletRequest req, java.lang.String folderName)
           
static void deleteMessages(javax.servlet.http.HttpServletRequest req, org.apache.commons.collections.map.MultiValueMap msgMap)
           
static void deleteMessages(javax.servlet.http.HttpServletRequest req, org.apache.commons.collections.map.MultiValueMap msgMap, boolean permanently)
           
static void emptyFolder(javax.servlet.http.HttpServletRequest req, java.lang.String folderName)
           
static java.lang.Object[] getAttachment(javax.servlet.http.HttpServletRequest req, java.lang.String contentPath)
           
static java.util.Set getEnvelopes(javax.servlet.http.HttpServletRequest req, java.util.Comparator comparator)
           
static MailFolder getFolder(javax.servlet.http.HttpServletRequest req)
           
static java.lang.String getFolderName(javax.servlet.http.HttpServletRequest req)
           
static java.util.List getFolders(javax.servlet.http.HttpServletRequest req)
           
static MailMessage getMessage(javax.servlet.http.HttpServletRequest req)
           
static MailMessage getMessage(javax.servlet.http.HttpServletRequest req, long messageId)
           
static long getMessageId(javax.servlet.http.HttpServletRequest req)
           
static void moveMessages(javax.servlet.http.HttpServletRequest req, org.apache.commons.collections.map.MultiValueMap msgMap, java.lang.String toFolderName)
           
static void removeFolder(javax.servlet.http.HttpServletRequest req, java.lang.String folderName)
           
static void renameFolder(javax.servlet.http.HttpServletRequest req, java.lang.String oldFolderName, java.lang.String newFolderName)
           
static java.util.Set search(javax.servlet.http.HttpServletRequest req, MailDisplayTerms displayTerms, java.util.Comparator comparator)
           
static void setAccount(javax.servlet.http.HttpServletRequest req)
           
static void setFolder(javax.servlet.http.HttpServletRequest req, java.lang.String folderName)
           
static void setMessageId(javax.servlet.http.HttpServletRequest req, long messageId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAIL_BOX_STYLE

public static final java.lang.String MAIL_BOX_STYLE

MAIL_INBOX_NAME

public static final java.lang.String MAIL_INBOX_NAME

MAIL_DRAFTS_NAME

public static final java.lang.String MAIL_DRAFTS_NAME

MAIL_SENT_NAME

public static final java.lang.String MAIL_SENT_NAME

MAIL_SPAM_NAME

public static final java.lang.String MAIL_SPAM_NAME

MAIL_TRASH_NAME

public static final java.lang.String MAIL_TRASH_NAME

DEFAULT_FOLDERS

public static final java.lang.String[] DEFAULT_FOLDERS
Constructor Detail

MailUtil

public MailUtil()
Method Detail

completeMessage

public static void completeMessage(javax.servlet.http.HttpServletRequest req,
                                   MailMessage mailMessage,
                                   boolean send,
                                   java.lang.String originalId,
                                   boolean wasDraft)
                            throws ContentException,
                                   ContentPathException,
                                   FolderException,
                                   com.liferay.util.mail.MailServerException,
                                   RecipientException,
                                   StoreException
Throws:
ContentException
ContentPathException
FolderException
com.liferay.util.mail.MailServerException
RecipientException
StoreException

createFolder

public static void createFolder(javax.servlet.http.HttpServletRequest req,
                                java.lang.String folderName)
                         throws FolderException,
                                com.liferay.util.mail.MailServerException,
                                StoreException
Throws:
FolderException
com.liferay.util.mail.MailServerException
StoreException

deleteMessages

public static void deleteMessages(javax.servlet.http.HttpServletRequest req,
                                  org.apache.commons.collections.map.MultiValueMap msgMap)
                           throws FolderException,
                                  com.liferay.util.mail.MailServerException,
                                  StoreException
Throws:
FolderException
com.liferay.util.mail.MailServerException
StoreException

deleteMessages

public static void deleteMessages(javax.servlet.http.HttpServletRequest req,
                                  org.apache.commons.collections.map.MultiValueMap msgMap,
                                  boolean permanently)
                           throws FolderException,
                                  com.liferay.util.mail.MailServerException,
                                  StoreException
Throws:
FolderException
com.liferay.util.mail.MailServerException
StoreException

emptyFolder

public static void emptyFolder(javax.servlet.http.HttpServletRequest req,
                               java.lang.String folderName)
                        throws FolderException,
                               com.liferay.util.mail.MailServerException,
                               StoreException
Throws:
FolderException
com.liferay.util.mail.MailServerException
StoreException

getAttachment

public static java.lang.Object[] getAttachment(javax.servlet.http.HttpServletRequest req,
                                               java.lang.String contentPath)
                                        throws ContentException,
                                               ContentPathException,
                                               FolderException,
                                               com.liferay.util.mail.MailServerException,
                                               StoreException
Throws:
ContentException
ContentPathException
FolderException
com.liferay.util.mail.MailServerException
StoreException

getEnvelopes

public static java.util.Set getEnvelopes(javax.servlet.http.HttpServletRequest req,
                                         java.util.Comparator comparator)
                                  throws FolderException
Throws:
FolderException

getFolder

public static MailFolder getFolder(javax.servlet.http.HttpServletRequest req)
                            throws FolderException,
                                   com.liferay.util.mail.MailServerException,
                                   javax.mail.MessagingException,
                                   StoreException
Throws:
FolderException
com.liferay.util.mail.MailServerException
javax.mail.MessagingException
StoreException

getFolderName

public static java.lang.String getFolderName(javax.servlet.http.HttpServletRequest req)
                                      throws FolderException,
                                             StoreException
Throws:
FolderException
StoreException

getFolders

public static java.util.List getFolders(javax.servlet.http.HttpServletRequest req)
                                 throws FolderException,
                                        com.liferay.util.mail.MailServerException,
                                        StoreException
Throws:
FolderException
com.liferay.util.mail.MailServerException
StoreException

getMessage

public static MailMessage getMessage(javax.servlet.http.HttpServletRequest req)
                              throws ContentException,
                                     FolderException,
                                     StoreException
Throws:
ContentException
FolderException
StoreException

getMessage

public static MailMessage getMessage(javax.servlet.http.HttpServletRequest req,
                                     long messageId)
                              throws ContentException,
                                     FolderException,
                                     StoreException
Throws:
ContentException
FolderException
StoreException

getMessageId

public static long getMessageId(javax.servlet.http.HttpServletRequest req)
                         throws ContentException,
                                FolderException,
                                StoreException
Throws:
ContentException
FolderException
StoreException

moveMessages

public static void moveMessages(javax.servlet.http.HttpServletRequest req,
                                org.apache.commons.collections.map.MultiValueMap msgMap,
                                java.lang.String toFolderName)
                         throws FolderException,
                                com.liferay.util.mail.MailServerException,
                                StoreException
Throws:
FolderException
com.liferay.util.mail.MailServerException
StoreException

removeFolder

public static void removeFolder(javax.servlet.http.HttpServletRequest req,
                                java.lang.String folderName)
                         throws FolderException,
                                com.liferay.util.mail.MailServerException,
                                StoreException
Throws:
FolderException
com.liferay.util.mail.MailServerException
StoreException

renameFolder

public static void renameFolder(javax.servlet.http.HttpServletRequest req,
                                java.lang.String oldFolderName,
                                java.lang.String newFolderName)
                         throws FolderException,
                                com.liferay.util.mail.MailServerException,
                                StoreException
Throws:
FolderException
com.liferay.util.mail.MailServerException
StoreException

search

public static java.util.Set search(javax.servlet.http.HttpServletRequest req,
                                   MailDisplayTerms displayTerms,
                                   java.util.Comparator comparator)
                            throws FolderException,
                                   com.liferay.util.mail.MailServerException,
                                   StoreException
Throws:
FolderException
com.liferay.util.mail.MailServerException
StoreException

setAccount

public static void setAccount(javax.servlet.http.HttpServletRequest req)

setFolder

public static void setFolder(javax.servlet.http.HttpServletRequest req,
                             java.lang.String folderName)
                      throws FolderException,
                             com.liferay.util.mail.MailServerException,
                             StoreException
Throws:
FolderException
com.liferay.util.mail.MailServerException
StoreException

setMessageId

public static void setMessageId(javax.servlet.http.HttpServletRequest req,
                                long messageId)

cleanUp

protected static void cleanUp(javax.servlet.http.HttpSession ses)
                       throws StoreException
Throws:
StoreException