|
Goals | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjocundmail.MailReader
public class MailReader
This is a class to facilitate mail server communication. At the moment it supports only POP communication, with plain text authentication. It should be expanded to other protocols and authentication types.
| 0.4.0 | Basic implementation for intial testing. | DONE! |
| 0.8.0 | New Mail Detection | |
| 1.0.0 | First release version - More specifics to come. |
| (5/28/07) | There is a very basic implementation that supports plain text AUTH and then a few ways of retrievign messages from the server. |
| Field Summary | |
|---|---|
boolean |
box_dirty
At the moment public, but will probably be changed to be protected |
int |
dirty_count
At the moment public, but will probably be changed to be protected |
int |
dirty_size
At the moment public, but will probably be changed to be protected |
java.io.BufferedReader |
inbuf
At the moment public, but will probably be changed to be protected |
java.io.InputStream |
istream
At the moment public, but will probably be changed to be protected |
java.net.Socket |
mail_serv
At the moment public, but will probably be changed to be protected |
java.io.OutputStream |
ostream
At the moment public, but will probably be changed to be protected |
java.io.BufferedWriter |
outbuf
At the moment public, but will probably be changed to be protected |
int |
total_count
At the moment public, but will probably be changed to be protected |
int |
total_size
At the moment public, but will probably be changed to be protected |
| Constructor Summary | |
|---|---|
MailReader(java.lang.String mail_host)
Attempts to start a mail reading session with the host supplied. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the connection with the server. |
java.lang.String |
list()
POP - list command |
boolean |
login(java.lang.String user,
java.lang.String pass)
Logs into the server using plain text AUTH, and given credentials |
static void |
main(java.lang.String[] args)
A test program for this class |
int |
readMail()
No Implementation |
byte[] |
retr_byte(int i)
POP - retr command -- might not work |
void |
retr_test(int msg)
A debugging function...has some additional info when downloading the message from the server, as well as prints out the message in byte array form. |
java.lang.String |
retr(int i)
POP - Retr command...I won't garuntee this works... |
void |
retr(int i,
java.io.File file)
POP - retr command -- best solution Downloads the message from the server into File supplied |
void |
sendLine(java.lang.String line)
Sends a line to the server after appending "\r\n" |
java.lang.String |
stat()
POP - Stat command |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int total_count
public int total_size
public int dirty_count
public int dirty_size
public boolean box_dirty
public java.net.Socket mail_serv
public java.io.InputStream istream
public java.io.OutputStream ostream
public java.io.BufferedReader inbuf
public java.io.BufferedWriter outbuf
| Constructor Detail |
|---|
public MailReader(java.lang.String mail_host)
mail_host - Should be a host in host:port form.| Method Detail |
|---|
public void close()
public void sendLine(java.lang.String line)
line - Line to send to the server
public boolean login(java.lang.String user,
java.lang.String pass)
user - Username to login withpass - Password to login withpublic java.lang.String stat()
public java.lang.String retr(int i)
i - The index of the message on the server
public void retr_test(int msg)
msg - Index of the message on the serverpublic byte[] retr_byte(int i)
i - The index of the message on the server
public void retr(int i,
java.io.File file)
i - The index of the message on the serverfile - The file the message is to be saved to.public java.lang.String list()
public int readMail()
public static void main(java.lang.String[] args)
args - Retrieves index args[0]
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||