Package net.fortuna.mstor.model
Class MStorFolder
- java.lang.Object
-
- javax.mail.Folder
-
- net.fortuna.mstor.model.MStorFolder
-
- All Implemented Interfaces:
AutoCloseable,javax.mail.UIDFolder
public final class MStorFolder extends javax.mail.Folder implements javax.mail.UIDFolderA folder implementation for the mstor javamail provider.
-
-
Constructor Summary
Constructors Constructor Description MStorFolder(MStorStore store, FolderDelegate<? extends MessageDelegate> delegate)Constructs a new mstor folder instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendMessages(javax.mail.Message[] messages)Appends the specified messages to this folder.voidclose(boolean expunge)booleancreate(int type)booleandelete(boolean recurse)booleanexists()javax.mail.Message[]expunge()intgetDeletedMessageCount()javax.mail.FoldergetFolder(String name)StringgetFullName()javax.mail.MessagegetMessage(int index)javax.mail.MessagegetMessageByUID(long uid)intgetMessageCount()javax.mail.Message[]getMessagesByUID(long[] uids)javax.mail.Message[]getMessagesByUID(long start, long end)StringgetName()javax.mail.FoldergetParent()javax.mail.FlagsgetPermanentFlags()chargetSeparator()intgetType()longgetUID(javax.mail.Message message)longgetUIDNext()longgetUIDValidity()booleanhasNewMessages()booleanisOpen()javax.mail.Folder[]list(String pattern)voidopen(int mode)booleanrenameTo(javax.mail.Folder folder)-
Methods inherited from class javax.mail.Folder
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, close, copyMessages, fetch, finalize, getMessages, getMessages, getMessages, getMode, getNewMessageCount, getStore, getUnreadMessageCount, getURLName, isSubscribed, list, listSubscribed, listSubscribed, notifyConnectionListeners, notifyFolderListeners, notifyFolderRenamedListeners, notifyMessageAddedListeners, notifyMessageChangedListeners, notifyMessageRemovedListeners, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, search, search, setFlags, setFlags, setFlags, setSubscribed, toString
-
-
-
-
Constructor Detail
-
MStorFolder
public MStorFolder(MStorStore store, FolderDelegate<? extends MessageDelegate> delegate)
Constructs a new mstor folder instance.- Parameters:
store- the mail store this folder belongs todelegate- a folder delegate that provides implementation-specific folder functionality
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein classjavax.mail.Folder
-
getFullName
public String getFullName()
- Specified by:
getFullNamein classjavax.mail.Folder
-
getParent
public javax.mail.Folder getParent()
- Specified by:
getParentin classjavax.mail.Folder
-
exists
public boolean exists()
- Specified by:
existsin classjavax.mail.Folder
-
list
public javax.mail.Folder[] list(String pattern) throws javax.mail.MessagingException
- Specified by:
listin classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
getSeparator
public char getSeparator() throws javax.mail.MessagingException- Specified by:
getSeparatorin classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
getType
public int getType() throws javax.mail.MessagingException- Specified by:
getTypein classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
create
public boolean create(int type) throws javax.mail.MessagingException- Specified by:
createin classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
hasNewMessages
public boolean hasNewMessages()
- Specified by:
hasNewMessagesin classjavax.mail.Folder
-
getFolder
public javax.mail.Folder getFolder(String name) throws javax.mail.MessagingException
- Specified by:
getFolderin classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
delete
public boolean delete(boolean recurse) throws javax.mail.MessagingException- Specified by:
deletein classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
renameTo
public boolean renameTo(javax.mail.Folder folder) throws javax.mail.MessagingException- Specified by:
renameToin classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
open
public void open(int mode) throws javax.mail.MessagingException- Specified by:
openin classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
close
public void close(boolean expunge) throws javax.mail.MessagingException- Specified by:
closein classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin classjavax.mail.Folder
-
getPermanentFlags
public javax.mail.Flags getPermanentFlags()
- Specified by:
getPermanentFlagsin classjavax.mail.Folder
-
getMessageCount
public int getMessageCount() throws javax.mail.MessagingException- Specified by:
getMessageCountin classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
getDeletedMessageCount
public int getDeletedMessageCount() throws javax.mail.MessagingException- Overrides:
getDeletedMessageCountin classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
getMessage
public javax.mail.Message getMessage(int index) throws javax.mail.MessagingException- Specified by:
getMessagein classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
appendMessages
public void appendMessages(javax.mail.Message[] messages) throws javax.mail.MessagingExceptionAppends the specified messages to this folder. NOTE: The specified message array is destroyed upon processing to alleviate memory concerns with large messages. You should ensure the messages specified in this array are referenced elsewhere if you want to retain them.- Specified by:
appendMessagesin classjavax.mail.Folder- Parameters:
messages- an array of messages to append to the folder- Throws:
javax.mail.MessagingException- where an unexpected error occurs appending messages to the folder
-
expunge
public javax.mail.Message[] expunge() throws javax.mail.MessagingException- Specified by:
expungein classjavax.mail.Folder- Throws:
javax.mail.MessagingException
-
getMessageByUID
public javax.mail.Message getMessageByUID(long uid) throws javax.mail.MessagingException- Specified by:
getMessageByUIDin interfacejavax.mail.UIDFolder- Throws:
javax.mail.MessagingException
-
getMessagesByUID
public javax.mail.Message[] getMessagesByUID(long start, long end) throws javax.mail.MessagingException- Specified by:
getMessagesByUIDin interfacejavax.mail.UIDFolder- Throws:
javax.mail.MessagingException
-
getMessagesByUID
public javax.mail.Message[] getMessagesByUID(long[] uids) throws javax.mail.MessagingException- Specified by:
getMessagesByUIDin interfacejavax.mail.UIDFolder- Throws:
javax.mail.MessagingException
-
getUID
public long getUID(javax.mail.Message message) throws javax.mail.MessagingException- Specified by:
getUIDin interfacejavax.mail.UIDFolder- Throws:
javax.mail.MessagingException
-
getUIDNext
public long getUIDNext()
- Specified by:
getUIDNextin interfacejavax.mail.UIDFolder
-
getUIDValidity
public long getUIDValidity() throws javax.mail.MessagingException- Specified by:
getUIDValidityin interfacejavax.mail.UIDFolder- Throws:
javax.mail.MessagingException
-
-