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.UIDFolder
A 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 void
appendMessages(javax.mail.Message[] messages)
Appends the specified messages to this folder.void
close(boolean expunge)
boolean
create(int type)
boolean
delete(boolean recurse)
boolean
exists()
javax.mail.Message[]
expunge()
int
getDeletedMessageCount()
javax.mail.Folder
getFolder(String name)
String
getFullName()
javax.mail.Message
getMessage(int index)
javax.mail.Message
getMessageByUID(long uid)
int
getMessageCount()
javax.mail.Message[]
getMessagesByUID(long[] uids)
javax.mail.Message[]
getMessagesByUID(long start, long end)
String
getName()
javax.mail.Folder
getParent()
javax.mail.Flags
getPermanentFlags()
char
getSeparator()
int
getType()
long
getUID(javax.mail.Message message)
long
getUIDNext()
long
getUIDValidity()
boolean
hasNewMessages()
boolean
isOpen()
javax.mail.Folder[]
list(String pattern)
void
open(int mode)
boolean
renameTo(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:
getName
in classjavax.mail.Folder
-
getFullName
public String getFullName()
- Specified by:
getFullName
in classjavax.mail.Folder
-
getParent
public javax.mail.Folder getParent()
- Specified by:
getParent
in classjavax.mail.Folder
-
exists
public boolean exists()
- Specified by:
exists
in classjavax.mail.Folder
-
list
public javax.mail.Folder[] list(String pattern) throws javax.mail.MessagingException
- Specified by:
list
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
getSeparator
public char getSeparator() throws javax.mail.MessagingException
- Specified by:
getSeparator
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
getType
public int getType() throws javax.mail.MessagingException
- Specified by:
getType
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
create
public boolean create(int type) throws javax.mail.MessagingException
- Specified by:
create
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
hasNewMessages
public boolean hasNewMessages()
- Specified by:
hasNewMessages
in classjavax.mail.Folder
-
getFolder
public javax.mail.Folder getFolder(String name) throws javax.mail.MessagingException
- Specified by:
getFolder
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
delete
public boolean delete(boolean recurse) throws javax.mail.MessagingException
- Specified by:
delete
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
renameTo
public boolean renameTo(javax.mail.Folder folder) throws javax.mail.MessagingException
- Specified by:
renameTo
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
open
public void open(int mode) throws javax.mail.MessagingException
- Specified by:
open
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
close
public void close(boolean expunge) throws javax.mail.MessagingException
- Specified by:
close
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in classjavax.mail.Folder
-
getPermanentFlags
public javax.mail.Flags getPermanentFlags()
- Specified by:
getPermanentFlags
in classjavax.mail.Folder
-
getMessageCount
public int getMessageCount() throws javax.mail.MessagingException
- Specified by:
getMessageCount
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
getDeletedMessageCount
public int getDeletedMessageCount() throws javax.mail.MessagingException
- Overrides:
getDeletedMessageCount
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
getMessage
public javax.mail.Message getMessage(int index) throws javax.mail.MessagingException
- Specified by:
getMessage
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
appendMessages
public void appendMessages(javax.mail.Message[] messages) throws javax.mail.MessagingException
Appends 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:
appendMessages
in 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:
expunge
in classjavax.mail.Folder
- Throws:
javax.mail.MessagingException
-
getMessageByUID
public javax.mail.Message getMessageByUID(long uid) throws javax.mail.MessagingException
- Specified by:
getMessageByUID
in interfacejavax.mail.UIDFolder
- Throws:
javax.mail.MessagingException
-
getMessagesByUID
public javax.mail.Message[] getMessagesByUID(long start, long end) throws javax.mail.MessagingException
- Specified by:
getMessagesByUID
in interfacejavax.mail.UIDFolder
- Throws:
javax.mail.MessagingException
-
getMessagesByUID
public javax.mail.Message[] getMessagesByUID(long[] uids) throws javax.mail.MessagingException
- Specified by:
getMessagesByUID
in interfacejavax.mail.UIDFolder
- Throws:
javax.mail.MessagingException
-
getUID
public long getUID(javax.mail.Message message) throws javax.mail.MessagingException
- Specified by:
getUID
in interfacejavax.mail.UIDFolder
- Throws:
javax.mail.MessagingException
-
getUIDNext
public long getUIDNext()
- Specified by:
getUIDNext
in interfacejavax.mail.UIDFolder
-
getUIDValidity
public long getUIDValidity() throws javax.mail.MessagingException
- Specified by:
getUIDValidity
in interfacejavax.mail.UIDFolder
- Throws:
javax.mail.MessagingException
-
-