|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.net.SocketClient
org.apache.commons.net.imap.IMAP
public class IMAP
The IMAP class provides the basic the functionality necessary to implement your own IMAP client.
| Nested Class Summary | |
|---|---|
static class |
IMAP.IMAPState
|
| Field Summary | |
|---|---|
protected static String |
__DEFAULT_ENCODING
The default control socket ecoding. |
protected BufferedWriter |
__writer
|
protected BufferedReader |
_reader
|
static int |
DEFAULT_PORT
The default IMAP port (RFC 3501). |
| Fields inherited from class org.apache.commons.net.SocketClient |
|---|
_defaultPort_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL |
| Constructor Summary | |
|---|---|
IMAP()
The default IMAPClient constructor. |
|
| Method Summary | |
|---|---|
protected void |
_connectAction_()
Performs connection initialization and sets state to IMAP.IMAPState.NOT_AUTH_STATE. |
void |
disconnect()
Disconnects the client from the server, and sets the state to DISCONNECTED_STATE . |
boolean |
doCommand(IMAPCommand command)
Sends a command to the server and return whether successful. |
boolean |
doCommand(IMAPCommand command,
String args)
Sends a command and arguments to the server and return whether successful. |
protected String |
generateCommandID()
Generates a new command ID (tag) for a command. |
String |
getReplyString()
Returns the reply to the last command sent to the server. |
String[] |
getReplyStrings()
Returns an array of lines received as a reply to the last command sent to the server. |
IMAP.IMAPState |
getState()
Returns the current IMAP client state. |
int |
sendCommand(IMAPCommand command)
Sends a command with no arguments to the server and returns the reply code. |
int |
sendCommand(IMAPCommand command,
String args)
Sends a command and arguments to the server and returns the reply code. |
int |
sendCommand(String command)
Sends a command with no arguments to the server and returns the reply code. |
int |
sendCommand(String command,
String args)
Sends a command an arguments to the server and returns the reply code. |
int |
sendData(String command)
Sends data to the server and returns the reply code. |
protected void |
setState(IMAP.IMAPState state)
Sets IMAP client state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_PORT
protected static final String __DEFAULT_ENCODING
protected BufferedWriter __writer
protected BufferedReader _reader
| Constructor Detail |
|---|
public IMAP()
DISCONNECTED_STATE.
| Method Detail |
|---|
protected void _connectAction_()
throws IOException
IMAP.IMAPState.NOT_AUTH_STATE.
_connectAction_ in class SocketClientIOExceptionprotected void setState(IMAP.IMAPState state)
_STATE constants.
state - The new state.public IMAP.IMAPState getState()
public void disconnect()
throws IOException
DISCONNECTED_STATE . The reply text information
from the last issued command is voided to allow garbage collection
of the memory used to store that information.
disconnect in class SocketClientIOException - If there is an error in disconnecting.
public int sendCommand(String command,
String args)
throws IOException
command - The IMAP command to send.args - The command arguments.
IOException
public int sendCommand(String command)
throws IOException
command - The IMAP command to send.
IOException
public int sendCommand(IMAPCommand command,
String args)
throws IOException
command - The IMAP command to send
(one of the IMAPCommand constants).args - The command arguments.
IOException
public boolean doCommand(IMAPCommand command,
String args)
throws IOException
command - The IMAP command to send
(one of the IMAPCommand constants).args - The command arguments.
true if the command was successful
IOException
public int sendCommand(IMAPCommand command)
throws IOException
command - The IMAP command to send
(one of the IMAPCommand constants).
IOException
public boolean doCommand(IMAPCommand command)
throws IOException
command - The IMAP command to send
(one of the IMAPCommand constants).
true if the command was successful
IOException
public int sendData(String command)
throws IOException
command - The IMAP command to send.
IOExceptionpublic String[] getReplyStrings()
public String getReplyString()
protected String generateCommandID()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||