i2p.susi.webmail
Class Mail

java.lang.Object
  extended by i2p.susi.webmail.Mail

 class Mail
extends Object

data structure to hold a single message, mostly used with folder view and sorting

Author:
susi

Field Summary
(package private)  String[] cc
           
 String contentType
           
 Date date
           
 String dateString
           
 String error
           
 String formattedDate
           
 String formattedSubject
           
 String localFormattedDate
           
 boolean markForDeletion
           
 String quotedDate
           
 String reply
           
 String sender
           
 String shortSender
           
 String shortSubject
           
 String subject
           
(package private)  String[] to
           
 String uidl
           
 
Constructor Summary
Mail(String uidl)
           
 
Method Summary
static void appendRecipients(StringBuilder buf, ArrayList<String> recipients, String prefix)
          Adds all items from the list to the builder, separated by tabs.
static String getAddress(String address)
          Returns the first email address portion, enclosed by <>
 ReadBuffer getBody()
          This contains the header also.
 ReadBuffer getHeader()
          This may or may not contain the body also.
 MailPart getPart()
           
static boolean getRecipientsFromList(ArrayList<String> recipients, String text, boolean ok)
          A little misnamed.
 int getSize()
           
 boolean hasAttachment()
           
 boolean hasBody()
           
 boolean hasHeader()
           
 boolean hasPart()
           
 boolean isNew()
           
 boolean isSpam()
           
 void setBody(ReadBuffer rb)
           
 void setHeader(ReadBuffer rb)
           
 void setNew(boolean isNew)
           
 void setSize(int size)
           
static boolean validateAddress(String address)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sender

public String sender

reply

public String reply

subject

public String subject

dateString

public String dateString

formattedSubject

public String formattedSubject

formattedDate

public String formattedDate

localFormattedDate

public String localFormattedDate

shortSender

public String shortSender

shortSubject

public String shortSubject

quotedDate

public String quotedDate

uidl

public final String uidl

date

public Date date

to

String[] to

cc

String[] cc

contentType

public String contentType

error

public String error

markForDeletion

public boolean markForDeletion
Constructor Detail

Mail

public Mail(String uidl)
Method Detail

getHeader

public ReadBuffer getHeader()
This may or may not contain the body also.

Returns:
may be null

setHeader

public void setHeader(ReadBuffer rb)

hasHeader

public boolean hasHeader()

getBody

public ReadBuffer getBody()
This contains the header also.

Returns:
may be null

setBody

public void setBody(ReadBuffer rb)

hasBody

public boolean hasBody()

getPart

public MailPart getPart()

hasPart

public boolean hasPart()

getSize

public int getSize()

setSize

public void setSize(int size)

isSpam

public boolean isSpam()

isNew

public boolean isNew()

setNew

public void setNew(boolean isNew)

hasAttachment

public boolean hasAttachment()

validateAddress

public static boolean validateAddress(String address)
Parameters:
address - E-mail address to be validated
Returns:
Is the e-mail address valid?

getAddress

public static String getAddress(String address)
Returns the first email address portion, enclosed by <>

Parameters:
address -

getRecipientsFromList

public static boolean getRecipientsFromList(ArrayList<String> recipients,
                                            String text,
                                            boolean ok)
A little misnamed. Adds all addresses from the comma-separated line in text to the recipients list.

Parameters:
text - comma-separated
recipients - out param
ok - will be returned
Returns:
true if ALL e-mail addresses are valid AND the in parameter was true

appendRecipients

public static void appendRecipients(StringBuilder buf,
                                    ArrayList<String> recipients,
                                    String prefix)
Adds all items from the list to the builder, separated by tabs.

Parameters:
buf - out param
prefix - prepended to the addresses