|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.mail.Folder
com.emarsys.ecommon.mail.mock.MockFolder
com.emarsys.ecommon.mail.mock.PopMockFolder
public class PopMockFolder
A MockFolder
that mimics some behavior of
POP3Folder
(the default POP3 provider in javamail).
Field Summary |
---|
Fields inherited from class com.emarsys.ecommon.mail.mock.MockFolder |
---|
mailbox, name, open |
Fields inherited from class javax.mail.Folder |
---|
HOLDS_FOLDERS, HOLDS_MESSAGES, mode, READ_ONLY, READ_WRITE, store |
Constructor Summary | |
---|---|
PopMockFolder(MockStore store,
MockMailbox mailbox,
java.lang.String name)
|
Method Summary | |
---|---|
void |
appendMessages(javax.mail.Message[] msgs)
Always throws MethodNotSupportedException
because the POP3 protocol doesn't support appending messages. |
boolean |
create(int type)
Always returns false ; the POP3 protocol doesn't
support creating folders. |
boolean |
delete(boolean recurse)
Always throws MethodNotSupportedException
because the POP3 protocol doesn't allow the INBOX to
be deleted. |
boolean |
exists()
|
javax.mail.Message[] |
expunge()
Always throws MethodNotSupportedException
because the POP3 protocol doesn't support expunging messages
without closing the folder; call the close method
with the expunge argument set to true
instead. |
javax.mail.Folder |
getFolder(java.lang.String name)
Always throws MessagingException because no POP3 folders
can contain subfolders. |
javax.mail.Flags |
getPermanentFlags()
Always returns an empty Flags object because
the POP3 protocol doesn't support any permanent flags. |
char |
getSeparator()
Always returns a NUL character because POP3 doesn't support a hierarchy. |
int |
getType()
Always returns Folder.HOLDS_MESSAGES. |
boolean |
hasNewMessages()
Always returns false ; the POP3 protocol provides
no way to determine when a new message arrives. |
javax.mail.Folder[] |
list(java.lang.String pattern)
Always throws MessagingException because no POP3 folders
can contain subfolders. |
void |
open(int mode)
|
boolean |
renameTo(javax.mail.Folder f)
Always throws MethodNotSupportedException
because the POP3 protocol doesn't support multiple folders. |
Methods inherited from class com.emarsys.ecommon.mail.mock.MockFolder |
---|
close, doExpunge, getFullName, getInstance, getMailboxFolder, getMessage, getMessageCount, getName, getParent, isOpen |
Methods inherited from class javax.mail.Folder |
---|
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, copyMessages, fetch, finalize, getDeletedMessageCount, 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PopMockFolder(MockStore store, MockMailbox mailbox, java.lang.String name)
store
- mailbox
- name
- Method Detail |
---|
public void open(int mode) throws javax.mail.MessagingException
open
in class MockFolder
javax.mail.MessagingException
MockFolder.open(int)
public boolean exists() throws javax.mail.MessagingException
exists
in class MockFolder
javax.mail.MessagingException
MockFolder.exists()
public javax.mail.Folder[] list(java.lang.String pattern) throws javax.mail.MessagingException
MessagingException
because no POP3 folders
can contain subfolders.
list
in class MockFolder
javax.mail.MessagingException
- alwaysFolder.list(java.lang.String)
public char getSeparator()
getSeparator
in class MockFolder
Folder.getSeparator()
public int getType()
getType
in class MockFolder
Folder.getType()
public boolean create(int type) throws javax.mail.MessagingException
false
; the POP3 protocol doesn't
support creating folders.
create
in class MockFolder
javax.mail.MessagingException
Folder.create(int)
public boolean hasNewMessages() throws javax.mail.MessagingException
false
; the POP3 protocol provides
no way to determine when a new message arrives.
hasNewMessages
in class MockFolder
javax.mail.MessagingException
Folder.hasNewMessages()
public javax.mail.Folder getFolder(java.lang.String name) throws javax.mail.MessagingException
MessagingException
because no POP3 folders
can contain subfolders.
getFolder
in class MockFolder
javax.mail.MessagingException
- alwaysFolder.getFolder(java.lang.String)
public boolean delete(boolean recurse) throws javax.mail.MessagingException
MethodNotSupportedException
because the POP3 protocol doesn't allow the INBOX to
be deleted.
delete
in class MockFolder
javax.mail.MethodNotSupportedException
- always
javax.mail.MessagingException
Folder.delete(boolean)
public boolean renameTo(javax.mail.Folder f) throws javax.mail.MessagingException
MethodNotSupportedException
because the POP3 protocol doesn't support multiple folders.
renameTo
in class MockFolder
javax.mail.MethodNotSupportedException
- always
javax.mail.MessagingException
Folder.renameTo(javax.mail.Folder)
public javax.mail.Flags getPermanentFlags()
Flags
object because
the POP3 protocol doesn't support any permanent flags.
getPermanentFlags
in class MockFolder
Folder.getPermanentFlags()
public void appendMessages(javax.mail.Message[] msgs) throws javax.mail.MessagingException
MethodNotSupportedException
because the POP3 protocol doesn't support appending messages.
appendMessages
in class MockFolder
javax.mail.MethodNotSupportedException
- always
javax.mail.MessagingException
Folder.appendMessages(javax.mail.Message[])
public javax.mail.Message[] expunge() throws javax.mail.MessagingException
MethodNotSupportedException
because the POP3 protocol doesn't support expunging messages
without closing the folder; call the close
method
with the expunge
argument set to true
instead.
expunge
in class MockFolder
javax.mail.MethodNotSupportedException
- always
javax.mail.MessagingException
Folder.expunge()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |