| java.lang.Object com.quadcap.pop3.client.Session
Session | public class Session (Code) | | This class implementes a simple mapping of the POP3 protocol onto methods
of a java class.
author: Stan Bailes |
Field Summary | |
final public static int | CR Useful constant for CR. | final public static int | ERR Useful constant for ERR status. | final public static int | LF Useful constant for LF. | final public static int | OK Useful constant for OK status. | String | host server portion of host address. | InputStream | in Input (responses) from server. | OutputStream | out Output (commands) to the server. | int | port the port portion of the host address. | ByteArrayOutputStream | resp A temporary area used to collect server responses. | String | response The last response, as a string. | Socket | socket Sockect used to communicate with the server. |
Constructor Summary | |
public | Session(String host, int port) Construct a POP3 client object. |
CR | final public static int CR(Code) | | Useful constant for CR.
|
ERR | final public static int ERR(Code) | | Useful constant for ERR status.
|
LF | final public static int LF(Code) | | Useful constant for LF.
|
OK | final public static int OK(Code) | | Useful constant for OK status.
|
port | int port(Code) | | the port portion of the host address.
|
response | String response(Code) | | The last response, as a string.
|
socket | Socket socket(Code) | | Sockect used to communicate with the server.
|
Session | public Session(String host, int port)(Code) | | Construct a POP3 client object.
Initialize the host/port information, but don't actually open the
socket.
Parameters: host - the server's host name Parameters: port - the server's port number |
getResponse | public int getResponse() throws IOException(Code) | | Read a response line from the server. We expect this to be a string
of the form '+OK ...' or '-ERR ...'.
OK or ERR. |
getResponse | public InputStream getResponse(boolean get) throws IOException(Code) | | Prepare to read multi-line response. Return an input stream
which must be read to actually get the response.
|
simpleCmd | int simpleCmd(byte[] cmd, String val) throws IOException(Code) | | Execute a simple command which just expects an OR or ERR response.
|
writeCmd | void writeCmd(byte[] cmd, String val) throws IOException(Code) | | Write a POP3 command and arguments.
Parameters: cmd - a byte array containing the command literal Parameters: val - a String to be appended to the 'cmd' |
|
|