IMAPSClientpublic class IMAPClient extends IMAP
| Modifier and Type | Class | Description |
|---|---|---|
static class |
IMAPClient.FETCH_ITEM_NAMES |
The message data item names for the FETCH command defined in RFC 3501.
|
static class |
IMAPClient.SEARCH_CRITERIA |
The search criteria defined in RFC 3501.
|
static class |
IMAPClient.STATUS_DATA_ITEMS |
The status data items defined in RFC 3501.
|
IMAP.IMAPChunkListener, IMAP.IMAPState__DEFAULT_ENCODING, __writer, _reader, DEFAULT_PORT, TRUE_CHUNK_LISTENER_defaultPort_, _hostname_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL| Constructor | Description |
|---|---|
IMAPClient() |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
append(java.lang.String mailboxName) |
Deprecated.
(3.4) Does not work; the message body is not optional.
Use
append(String, String, String, String) instead. |
boolean |
append(java.lang.String mailboxName,
java.lang.String flags,
java.lang.String datetime) |
Deprecated.
(3.4) Does not work; the message body is not optional.
Use
append(String, String, String, String) instead. |
boolean |
append(java.lang.String mailboxName,
java.lang.String flags,
java.lang.String datetime,
java.lang.String message) |
Send an APPEND command to the server.
|
boolean |
capability() |
Send a CAPABILITY command to the server.
|
boolean |
check() |
Send a CHECK command to the server.
|
boolean |
close() |
Send a CLOSE command to the server.
|
boolean |
copy(java.lang.String sequenceSet,
java.lang.String mailboxName) |
Send a COPY command to the server.
|
boolean |
create(java.lang.String mailboxName) |
Send a CREATE command to the server.
|
boolean |
delete(java.lang.String mailboxName) |
Send a DELETE command to the server.
|
boolean |
examine(java.lang.String mailboxName) |
Send an EXAMINE command to the server.
|
boolean |
expunge() |
Send an EXPUNGE command to the server.
|
boolean |
fetch(java.lang.String sequenceSet,
java.lang.String itemNames) |
Send a FETCH command to the server.
|
boolean |
list(java.lang.String refName,
java.lang.String mailboxName) |
Send a LIST command to the server.
|
boolean |
login(java.lang.String username,
java.lang.String password) |
Login to the IMAP server with the given username and password.
|
boolean |
logout() |
Send a LOGOUT command to the server.
|
boolean |
lsub(java.lang.String refName,
java.lang.String mailboxName) |
Send an LSUB command to the server.
|
boolean |
noop() |
Send a NOOP command to the server.
|
boolean |
rename(java.lang.String oldMailboxName,
java.lang.String newMailboxName) |
Send a RENAME command to the server.
|
boolean |
search(java.lang.String criteria) |
Send a SEARCH command to the server.
|
boolean |
search(java.lang.String charset,
java.lang.String criteria) |
Send a SEARCH command to the server.
|
boolean |
select(java.lang.String mailboxName) |
Send a SELECT command to the server.
|
boolean |
status(java.lang.String mailboxName,
java.lang.String[] itemNames) |
Send a STATUS command to the server.
|
boolean |
store(java.lang.String sequenceSet,
java.lang.String itemNames,
java.lang.String itemValues) |
Send a STORE command to the server.
|
boolean |
subscribe(java.lang.String mailboxName) |
Send a SUBSCRIBE command to the server.
|
boolean |
uid(java.lang.String command,
java.lang.String commandArgs) |
Send a UID command to the server.
|
boolean |
unsubscribe(java.lang.String mailboxName) |
Send a UNSUBSCRIBE command to the server.
|
_connectAction_, disconnect, doCommand, doCommand, fireReplyReceived, generateCommandID, getReplyString, getReplyStrings, getState, sendCommand, sendCommand, sendCommand, sendCommand, sendData, setChunkListener, setStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddProtocolCommandListener, connect, connect, connect, connect, connect, connect, createCommandSupport, fireCommandSent, getCharset, getCharsetName, getCommandSupport, getConnectTimeout, getDefaultPort, getDefaultTimeout, getKeepAlive, getLocalAddress, getLocalPort, getProxy, getReceiveBufferSize, getRemoteAddress, getRemotePort, getSendBufferSize, getServerSocketFactory, getSoLinger, getSoTimeout, getTcpNoDelay, isAvailable, isConnected, removeProtocolCommandListener, setCharset, setConnectTimeout, setDefaultPort, setDefaultTimeout, setKeepAlive, setProxy, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemotepublic IMAPClient()
public boolean capability() throws java.io.IOException
true if the command was successful,false if not.java.io.IOException - If a network I/O error occurspublic boolean noop() throws java.io.IOException
true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean logout() throws java.io.IOException
true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean login(java.lang.String username, java.lang.String password) throws java.io.IOException
connect
before attempting to login. A login attempt is only valid if
the client is in the NOT_AUTH_STATE.
After logging in, the client enters the AUTH_STATE.username - The account name being logged in to.password - The plain text password of the account.java.io.IOException - If a network I/O error occurs in the process of
logging in.public boolean select(java.lang.String mailboxName) throws java.io.IOException
mailboxName - The mailbox name to select.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean examine(java.lang.String mailboxName) throws java.io.IOException
mailboxName - The mailbox name to examine.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean create(java.lang.String mailboxName) throws java.io.IOException
mailboxName - The mailbox name to create.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean delete(java.lang.String mailboxName) throws java.io.IOException
mailboxName - The mailbox name to delete.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean rename(java.lang.String oldMailboxName, java.lang.String newMailboxName) throws java.io.IOException
oldMailboxName - The existing mailbox name to rename.newMailboxName - The new mailbox name.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean subscribe(java.lang.String mailboxName) throws java.io.IOException
mailboxName - The mailbox name to subscribe to.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean unsubscribe(java.lang.String mailboxName) throws java.io.IOException
mailboxName - The mailbox name to unsubscribe from.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean list(java.lang.String refName, java.lang.String mailboxName) throws java.io.IOException
refName - The reference name.mailboxName - The mailbox name.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean lsub(java.lang.String refName, java.lang.String mailboxName) throws java.io.IOException
refName - The reference name.mailboxName - The mailbox name.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean status(java.lang.String mailboxName, java.lang.String[] itemNames) throws java.io.IOException
mailboxName - The reference name.itemNames - The status data item names.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean append(java.lang.String mailboxName, java.lang.String flags, java.lang.String datetime, java.lang.String message) throws java.io.IOException
mailboxName - The mailbox name.flags - The flag parenthesized list (optional).datetime - The date/time string (optional).message - The message to append.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.@Deprecated public boolean append(java.lang.String mailboxName, java.lang.String flags, java.lang.String datetime) throws java.io.IOException
append(String, String, String, String) instead.mailboxName - The mailbox name.flags - The flag parenthesized list (optional).datetime - The date/time string (optional).true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.@Deprecated public boolean append(java.lang.String mailboxName) throws java.io.IOException
append(String, String, String, String) instead.mailboxName - The mailbox name.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean check() throws java.io.IOException
true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean close() throws java.io.IOException
true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean expunge() throws java.io.IOException
true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean search(java.lang.String charset, java.lang.String criteria) throws java.io.IOException
charset - The charset (optional).criteria - The search criteria.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean search(java.lang.String criteria) throws java.io.IOException
criteria - The search criteria.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean fetch(java.lang.String sequenceSet, java.lang.String itemNames) throws java.io.IOException
sequenceSet - The sequence set to fetch (e.g. 1:4,6,11,100:*)itemNames - The item names for the FETCH command. (e.g. BODY.PEEK[HEADER.FIELDS (SUBJECT)])
If multiple item names are requested, these must be enclosed in parentheses, e.g. "(UID FLAGS BODY.PEEK[])"true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.IMAP.getReplyString(),
IMAP.getReplyStrings()public boolean store(java.lang.String sequenceSet, java.lang.String itemNames, java.lang.String itemValues) throws java.io.IOException
sequenceSet - The sequence set to update (e.g. 2:5)itemNames - The item name for the STORE command (i.e. [+|-]FLAGS[.SILENT])itemValues - The item values for the STORE command. (e.g. (\Deleted) )true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean copy(java.lang.String sequenceSet, java.lang.String mailboxName) throws java.io.IOException
sequenceSet - The sequence set to fetch.mailboxName - The mailbox name.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.public boolean uid(java.lang.String command, java.lang.String commandArgs) throws java.io.IOException
command - The command for UID.commandArgs - The arguments for the command.true if the command was successful,false if not.java.io.IOException - If a network I/O error occurs.