All Packages Class Hierarchy This Package Previous Next Index
Class COM.ibm.net.POP3Client
java.lang.Object
|
+----COM.ibm.net.InetProtocolClient
|
+----COM.ibm.net.POP3Client
- public class POP3Client
- extends InetProtocolClient
Implements a Post Office Protocol 3 (RFC 1939) client.
Internally supported POP3 commands:
USER PASS QUIT STAT LIST UIDL RETR TOP DELE RSET
Unsupported commands:
APOP
Copyright (c) Taligent, Inc. 1996 - 1997.
Copyright (c) IBM Corporation 1996 - 1997.
All Rights Reserved.
-
POP3Client()
- Empty default constructor.
-
POP3Client(String)
- Construct a POP3 session a mail server.
-
POP3Client(String, int)
- Construct a POP3 session with a mail server.
-
deleteMessage(String)
- Delete a message on the server.
-
listMessages()
- Retrieve list of messages.
-
listUniqueIdentifiers()
- Retrieve list of unique IDs, one for each available message.
-
logoff()
- Logoff mail server.
-
logon(String, String)
- Logon to mail server.
-
messageSize(String)
- Retrieve size (in bytes) of a message.
-
reset()
- Reset POP3 session with mail server.
-
retrieveMessage(String)
- Retrieve a buffered reader with which a message may be read.
-
retrieveMessageTop(String, int)
- Retrieve a buffered reader with which the top lines of a
message may be read.
-
status()
- Fetch "drop listing" (status) of the maildrop.
-
uniqueIdentifier(String)
- Retrieve the unique ID of a message.
POP3Client
public POP3Client()
- Empty default constructor.
POP3Client
public POP3Client(String mailServ)
- Construct a POP3 session a mail server. POP3Client
will use port 110 by default.
- Parameters:
- mailServ - Name or IP address of mail server
POP3Client
public POP3Client(String mailServ,
int port)
- Construct a POP3 session with a mail server.
- Parameters:
- mailServ - Name or IP address of mail server
- port - Port number of the server
logon
public void logon(String user,
String password) throws IOException
- Logon to mail server.
- Parameters:
- user - User name
- password - User password
- Throws: IOException
- Could not logon
logoff
public void logoff() throws IOException
- Logoff mail server.
- Throws: IOException
- Could not logoff
status
public String status() throws IOException
- Fetch "drop listing" (status) of the maildrop.
- Returns:
- A string containing
(at least) two tokens: first is the number of messages and the
second the total bytecount of the messages.
- Throws: IOException
- Could not retrieve server status
listMessages
public String[] listMessages() throws IOException
- Retrieve list of messages.
- Returns:
- An array of message strings, each containing two tokens
separated by a single whitespace. The first token is the
message number and the second its size (in bytes).
- Throws: IOException
- Could not retrieve message list
uniqueIdentifier
public String uniqueIdentifier(String msgNum) throws IOException
- Retrieve the unique ID of a message.
- Parameters:
- msgNum - Number of the message to query
- Returns:
- A string containing two tokens separated by a single
whitespace. The first token is the message number and the
second its unique ID.
- Throws: IOException
- Could not unique ID
listUniqueIdentifiers
public String[] listUniqueIdentifiers() throws IOException
- Retrieve list of unique IDs, one for each available message.
- Returns:
- A string array, each element containing
two tokens separated by a single whitespace.
The first token is the message number and the second its
unique ID.
- Throws: IOException
- Could not unique IDs
messageSize
public int messageSize(String msgNum) throws IOException
- Retrieve size (in bytes) of a message.
- Parameters:
- msgNum - Number of the message to query
- Returns:
- Size (in bytes) of the message
- Throws: IOException
- Could not retrieve message size
retrieveMessage
public BufferedReader retrieveMessage(String msgNum) throws IOException
- Retrieve a buffered reader with which a message may be read.
A line containing only "." terminates the message.
Lines that originally began with a single '.' have it doubled;
strip one during retrieval to produce the original message body.
Do not close the reader stream after completion.
- Parameters:
- msgNum - Number of the message to query
- Returns:
- Buffered reader
- Throws: IOException
- Could not retrieve message size
- See Also:
- BufferedReader;
retrieveMessageTop
public BufferedReader retrieveMessageTop(String msgNum,
int lines) throws IOException
- Retrieve a buffered reader with which the top lines of a
message may be read.
A line containing only "." indicates terminates the message.
Lines that originally began with a single '.' have it doubled;
strip one during retrieval to produce the original message body.
Do not close the reader stream after completion.
- Parameters:
- msgNum - Number of the message to query
- lines - Number of lines of the message to retrieve
- Returns:
- Buffered reader
- Throws: IOException
- Could not retrieve message top
- See Also:
- BufferedReader;
deleteMessage
public void deleteMessage(String msgNum) throws IOException
- Delete a message on the server.
- Parameters:
- msgNum - Number of message to delete
- Throws: IOException
- Could not retrieve message top
reset
public void reset() throws IOException
- Reset POP3 session with mail server.
- Throws: IOException
- Could not reset session
All Packages Class Hierarchy This Package Previous Next Index