public abstract class MailFolder extends Object implements Iterator
| Constructor and Description |
|---|
MailFolder(MailActivationSpec spec)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the mail session
|
protected void |
close(boolean checkSuccessful)
Closes a mail session
|
protected abstract void |
closeStore(boolean success,
javax.mail.Store store,
javax.mail.Folder folder)
Close a store
|
static MailFolder |
getInstance(MailActivationSpec mailActivationSpec)
Get an instance of a mail folder
|
protected abstract javax.mail.Message[] |
getMessages(javax.mail.Folder folder)
Get the messages from a folder
|
boolean |
hasNext() |
protected abstract void |
markMessageSeen(javax.mail.Message message)
Mark a message as seen
|
Object |
next() |
void |
open()
Open a mail session
|
protected abstract javax.mail.Store |
openStore(javax.mail.Session session)
Open a store
|
void |
remove() |
public MailFolder(MailActivationSpec spec)
spec - The mail activation specpublic void open()
throws Exception
Exception - Thrown if a session can't be establishedpublic void close()
throws javax.mail.MessagingException
javax.mail.MessagingException - Thrown if an error occurs duing closeprotected void close(boolean checkSuccessful)
checkSuccessful - Check if it was a successful closepublic static MailFolder getInstance(MailActivationSpec mailActivationSpec)
mailActivationSpec - The mail activation specnull if not IMAP / POP basedprotected abstract javax.mail.Store openStore(javax.mail.Session session)
throws javax.mail.NoSuchProviderException
session - The mail sessionjavax.mail.NoSuchProviderException - Thrown if there is no providerprotected abstract void closeStore(boolean success,
javax.mail.Store store,
javax.mail.Folder folder)
throws javax.mail.MessagingException
success - Check for successful closestore - The storefolder - The folderjavax.mail.MessagingException - Thrown if there is an errorprotected abstract javax.mail.Message[] getMessages(javax.mail.Folder folder)
throws javax.mail.MessagingException
folder - The folderjavax.mail.MessagingException - Thrown if there is an errorprotected abstract void markMessageSeen(javax.mail.Message message)
throws javax.mail.MessagingException
message - The messagesjavax.mail.MessagingException - Thrown if there is an errorCopyright © 2014 JBoss by Red Hat. All rights reserved.