|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--de.trantor.mail.InboxClient
|
+--de.trantor.mail.ImapClient
Encapsulates the IMAP v4.1 protocol as specified in RFC 2060. This class provides a simple interface to a IMAP mailbox. After a session has been established using the open() method, the number of available messages can be queried by calling the getMessageCount() method, and arbitrary messages or their headers can be retrieved from the mailbox using getMessage() or getHeaders(), respectively. Deleting messages is possible using removeMessage(). Each IMAP session should be terminated by a call to the close() method.
MailException,
SmtpClient,
Message| Field Summary |
| Fields inherited from class de.trantor.mail.InboxClient |
connection |
| Constructor Summary | |
ImapClient()
Creates a new ImapClient instance. |
|
ImapClient(Connection connection)
Creates a new ImapClient instance with a given Connection instance. |
|
| Method Summary | |
void |
close()
Ends the mailbox session. |
Message |
getHeaders(int index)
Retrieves a message's headers from the mailbox. |
Message |
getMessage(int index)
Retrieves a message from the mailbox. |
int |
getMessageCount()
Queries the number of messages currently available in the mailbox. |
int |
getSize(int index)
Queries the size of a message. |
java.lang.String |
getUniqueId(int index)
Queries the unique ID of a message as assigned by the server that holds the mailbox. |
void |
open(java.lang.String host,
int port,
boolean ssl,
java.lang.String user,
java.lang.String pass)
Opens a mailbox session. |
void |
removeMessage(int index)
Removes a message from the mailbox. |
| Methods inherited from class de.trantor.mail.InboxClient |
connected, getDebug, open, setDebug |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ImapClient()
public ImapClient(Connection connection)
| Method Detail |
public void open(java.lang.String host,
int port,
boolean ssl,
java.lang.String user,
java.lang.String pass)
throws java.io.IOException,
MailException
InboxClient
open in class InboxClientjava.io.IOException
MailExceptionInboxClient.open(String, String, String),
InboxClient.close(),
InboxClient.connected()
public void close()
throws java.io.IOException,
MailException
InboxClient
close in class InboxClientjava.io.IOException
MailExceptionInboxClient.open(java.lang.String, java.lang.String, java.lang.String),
InboxClient.connected()
public int getMessageCount()
throws java.io.IOException,
MailException
InboxClient
getMessageCount in class InboxClientjava.io.IOException
MailExceptionInboxClient.getMessage(int),
InboxClient.getHeaders(int),
InboxClient.removeMessage(int)
public Message getMessage(int index)
throws java.io.IOException,
MailException
InboxClient
getMessage in class InboxClientjava.io.IOException
MailExceptionInboxClient.getMessageCount(),
InboxClient.getHeaders(int)
public Message getHeaders(int index)
throws java.io.IOException,
MailException
InboxClient
getHeaders in class InboxClientjava.io.IOException
MailExceptionInboxClient.getMessageCount(),
InboxClient.getMessage(int)
public void removeMessage(int index)
throws java.io.IOException,
MailException
InboxClient
removeMessage in class InboxClientjava.io.IOException
MailExceptionInboxClient.getMessageCount()
public java.lang.String getUniqueId(int index)
throws java.io.IOException,
MailException
InboxClientMessage numbering follows the usual Java conventions for vectors. Thus the index must be a number ranging from 0 to getMessageCount() - 1.
getUniqueId in class InboxClientjava.io.IOException
MailExceptionInboxClient.getMessageCount()
public int getSize(int index)
throws java.io.IOException,
MailException
InboxClientMessage numbering follows the usual Java conventions for vectors. Thus the index must be a number ranging from 0 to getMessageCount() - 1.
getSize in class InboxClientjava.io.IOException
MailExceptionInboxClient.getMessageCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||