Package org.jvnet.mock_javamail
Class MockFolder
- java.lang.Object
-
- jakarta.mail.Folder
-
- org.jvnet.mock_javamail.MockFolder
-
- All Implemented Interfaces:
AutoCloseable
public class MockFolder extends jakarta.mail.Folder
- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description MockFolder(MockStore store, Mailbox mailbox)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendMessages(jakarta.mail.Message[] msgs)
void
close(boolean expunge)
boolean
create(int type)
boolean
delete(boolean recurse)
boolean
exists()
jakarta.mail.Message[]
expunge()
jakarta.mail.Folder
getFolder(String name)
String
getFullName()
jakarta.mail.Message
getMessage(int msgnum)
int
getMessageCount()
jakarta.mail.Message[]
getMessages(int low, int high)
String
getName()
int
getNewMessageCount()
jakarta.mail.Folder
getParent()
jakarta.mail.Flags
getPermanentFlags()
char
getSeparator()
int
getType()
boolean
hasNewMessages()
boolean
isOpen()
jakarta.mail.Folder[]
list(String pattern)
void
open(int mode)
boolean
renameTo(jakarta.mail.Folder f)
-
Methods inherited from class jakarta.mail.Folder
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, close, copyMessages, fetch, finalize, getDeletedMessageCount, getMessages, getMessages, getMode, getStore, getUnreadMessageCount, getURLName, isSubscribed, list, listSubscribed, listSubscribed, notifyConnectionListeners, notifyFolderListeners, notifyFolderRenamedListeners, notifyMessageAddedListeners, notifyMessageChangedListeners, notifyMessageRemovedListeners, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, search, search, setFlags, setFlags, setFlags, setSubscribed, toString
-
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in classjakarta.mail.Folder
-
getFullName
public String getFullName()
- Specified by:
getFullName
in classjakarta.mail.Folder
-
getParent
public jakarta.mail.Folder getParent() throws jakarta.mail.MessagingException
- Specified by:
getParent
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
exists
public boolean exists() throws jakarta.mail.MessagingException
- Specified by:
exists
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
list
public jakarta.mail.Folder[] list(String pattern) throws jakarta.mail.MessagingException
- Specified by:
list
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
getSeparator
public char getSeparator() throws jakarta.mail.MessagingException
- Specified by:
getSeparator
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
getType
public int getType() throws jakarta.mail.MessagingException
- Specified by:
getType
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
create
public boolean create(int type) throws jakarta.mail.MessagingException
- Specified by:
create
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
hasNewMessages
public boolean hasNewMessages() throws jakarta.mail.MessagingException
- Specified by:
hasNewMessages
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
getFolder
public jakarta.mail.Folder getFolder(String name) throws jakarta.mail.MessagingException
- Specified by:
getFolder
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
delete
public boolean delete(boolean recurse) throws jakarta.mail.MessagingException
- Specified by:
delete
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
renameTo
public boolean renameTo(jakarta.mail.Folder f) throws jakarta.mail.MessagingException
- Specified by:
renameTo
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
open
public void open(int mode) throws jakarta.mail.MessagingException
- Specified by:
open
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
close
public void close(boolean expunge) throws jakarta.mail.MessagingException
- Specified by:
close
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in classjakarta.mail.Folder
-
getPermanentFlags
public jakarta.mail.Flags getPermanentFlags()
- Specified by:
getPermanentFlags
in classjakarta.mail.Folder
-
getMessageCount
public int getMessageCount() throws jakarta.mail.MessagingException
- Specified by:
getMessageCount
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
getNewMessageCount
public int getNewMessageCount() throws jakarta.mail.MessagingException
- Overrides:
getNewMessageCount
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
getMessage
public jakarta.mail.Message getMessage(int msgnum) throws jakarta.mail.MessagingException
- Specified by:
getMessage
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
getMessages
public jakarta.mail.Message[] getMessages(int low, int high) throws jakarta.mail.MessagingException
- Overrides:
getMessages
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
appendMessages
public void appendMessages(jakarta.mail.Message[] msgs) throws jakarta.mail.MessagingException
- Specified by:
appendMessages
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
expunge
public jakarta.mail.Message[] expunge() throws jakarta.mail.MessagingException
- Specified by:
expunge
in classjakarta.mail.Folder
- Throws:
jakarta.mail.MessagingException
-
-