mail
Class MailArchive

java.lang.Object
  extended by mail.MailArchive

public class MailArchive
extends java.lang.Object

The MailArchive is used to store received mails. Mails can be saved in a tree-like structure. TODO: moving of mails, auto-correction of property-files, if mails changed

Author:
Arne Müller

Nested Class Summary
 class MailArchive.Folder
          represents a folder
 class MailArchive.MailEntry
          an Entry of a Mail in the Archive, the Mail can have an have already been decrypted, then the decrypted mail is stored here, too.
 
Field Summary
private  Communicator comm
           
private  EncSupply enc
          needed to encrypt received mails, so other can't read the mails
private static java.lang.String ID_LIST
           
private  MailArchive.Folder inbox
          the inbox, childfolder of root
private  java.io.File inboxDir
          the directory of the inbox on the harddisk
private static java.lang.String PROP_LIST
           
private  MailArchive.Folder root
          the root folder
private  User user
          the user, that owns the MailArchive
 
Constructor Summary
MailArchive(java.io.File basedir, User user, EncSupply enc)
          initializes, if necessary creates the MailArchive.
 
Method Summary
 MailArchive.Folder getRoot()
          returns the root folder of the archive
 Mail load(java.io.File f)
          loads a mail from a file
 MailArchive.MailEntry store(Mail m)
          stores a mail in the Inbox of the Archive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_LIST

private static final java.lang.String ID_LIST
See Also:
Constant Field Values

PROP_LIST

private static final java.lang.String PROP_LIST
See Also:
Constant Field Values

root

private MailArchive.Folder root
the root folder


inbox

private MailArchive.Folder inbox
the inbox, childfolder of root


inboxDir

private java.io.File inboxDir
the directory of the inbox on the harddisk


enc

private EncSupply enc
needed to encrypt received mails, so other can't read the mails


comm

private Communicator comm

user

private User user
the user, that owns the MailArchive

Constructor Detail

MailArchive

public MailArchive(java.io.File basedir,
                   User user,
                   EncSupply enc)
initializes, if necessary creates the MailArchive.

Parameters:
basedir -
user -
enc -
Method Detail

store

public MailArchive.MailEntry store(Mail m)
                            throws SavingException
stores a mail in the Inbox of the Archive

Parameters:
m -
Returns:
Throws:
SavingException

load

public Mail load(java.io.File f)
          throws org.xml.sax.SAXException,
                 java.io.IOException,
                 MailBuildException
loads a mail from a file

Parameters:
f -
Returns:
Throws:
org.xml.sax.SAXException
java.io.IOException
MailBuildException

getRoot

public MailArchive.Folder getRoot()
returns the root folder of the archive

Returns: