Interface MailReader
- All Known Implementing Classes:
DefaultMailReader, ExchangeMailReader, ImapMailReader
public interface MailReader
- Author:
- Joern Muehlencord (joern@muehlencord.de)
-
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()connects to the mailboxvoidcopyMessage(MailMessage mm, String sourceFolder, String destFolder) copies the given message from the source folder to the destination foldervoiddisconnects from mailboxreturns the default folderreturns the folder, if folder path is a valid path to an existing folderintgetMessageCount(String holdFolder) returns the amount of message in the given foldergetMessages(String folder) retrieves the list of messages stored in the given foldergetMessages(String folder, int start, int end) retrieves the list of messages stored in the given foldergetSubFolder(String sourceFolder) returns the list of subfolders of the specified source foldervoidmoveMessage(MailMessage mm, String sourceFolder, String destFolder) moves the given message from the source folder to the destination foldervoidsetSeenFlag(String folder, MailMessage mm, boolean flagValue) marks the messages as seen
-
Method Details
-
connect
connects to the mailbox- Throws:
MailReaderConnectionException- if he connection cannot be established
-
disconnect
void disconnect()disconnects from mailbox -
getDefaultFolder
returns the default folder- Returns:
- the default folder
- Throws:
MailReaderException- if the folder cannot be retrieved
-
getSubFolder
returns the list of subfolders of the specified source folder- Parameters:
sourceFolder- the folder to return the folder list for- Returns:
- the list of subfolders of the specified source folder
- Throws:
MailReaderException- if the folder list cannot be retrieved
-
getFolder
returns the folder, if folder path is a valid path to an existing folder- Parameters:
folderPath- the folder to return- Returns:
- the folder, if folder path is a valid path to an existing folder
- Throws:
MailReaderException- if the folder cannot be found
-
getMessageCount
returns the amount of message in the given folder- Parameters:
holdFolder- the folder to return the amount of messages for- Returns:
- the amount of message in the given folder
- Throws:
MailReaderException- if the folder cannot be accessed or the amount of messages cannot be determined
-
getMessages
retrieves the list of messages stored in the given folder- Parameters:
folder- the folder to search return the emails for- Returns:
- list of messages stored in the given folder
- Throws:
MailReaderException- if the message list cannot be retrieved
-
getMessages
retrieves the list of messages stored in the given folder- Parameters:
folder- the folder to search return the emails forstart- the number of the first messageend- the number of the last message- Returns:
- list of messages stored in the given folder
- Throws:
MailReaderException- if the message list cannot be retrieved
-