mail
Class MailArchive.Folder

java.lang.Object
  extended by mail.MailArchive.Folder
Enclosing class:
MailArchive

public class MailArchive.Folder
extends java.lang.Object

represents a folder

Author:
arne

Field Summary
private  java.io.File dir
          directory the folder is stored in
private  java.util.Properties ids
          maps the Mail-ID to the Filenames the Mails are stored by
private  java.util.Vector<MailArchive.MailEntry> mails
          stores the mails in the folder
private  int num
          greatest number a file is saved by
private  java.util.Properties props
          maps the Mail-filenames to their encryption properties (so they don't hav to be redecrypted, to get the info)
private  java.util.Vector<MailArchive.Folder> subfolder
          stores the subfolders in this folder
 
Constructor Summary
MailArchive.Folder(java.io.File dir)
          creates a new folder at the specified directory
 
Method Summary
 boolean equals(MailArchive.Folder f)
          two folder equal, if their directory equals
private  boolean exists(Mail m)
          tests, if a mail exists already TODO: this could also use mails-vector
 MailArchive.Folder getFolder(int i)
           
 int getIndex(MailArchive.Folder f)
           
 int getIndex(MailArchive.MailEntry me)
           
 MailArchive.MailEntry getMail(int i)
           
 void initFolder()
          loads the folder into their ram-representation
private  void initMails()
          loads the mails contained in this directory into the ram-stored vector
 int numFolder()
           
 int numMails()
           
 void setProps(java.lang.String name, java.lang.String props)
          sets the properties for a given mail-name and saves them
 MailArchive.MailEntry store(Mail m)
          stores a mail in this folder
 java.lang.String toString()
          prints this folders name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dir

private java.io.File dir
directory the folder is stored in


num

private int num
greatest number a file is saved by


ids

private java.util.Properties ids
maps the Mail-ID to the Filenames the Mails are stored by


props

private java.util.Properties props
maps the Mail-filenames to their encryption properties (so they don't hav to be redecrypted, to get the info)


mails

private java.util.Vector<MailArchive.MailEntry> mails
stores the mails in the folder


subfolder

private java.util.Vector<MailArchive.Folder> subfolder
stores the subfolders in this folder

Constructor Detail

MailArchive.Folder

public MailArchive.Folder(java.io.File dir)
creates a new folder at the specified directory

Parameters:
dir -
Method Detail

initMails

private void initMails()
loads the mails contained in this directory into the ram-stored vector


toString

public java.lang.String toString()
prints this folders name

Overrides:
toString in class java.lang.Object

exists

private boolean exists(Mail m)
tests, if a mail exists already TODO: this could also use mails-vector

Parameters:
m -
Returns:

setProps

public void setProps(java.lang.String name,
                     java.lang.String props)
              throws SavingException
sets the properties for a given mail-name and saves them

Parameters:
name -
props -
Throws:
SavingException

store

public MailArchive.MailEntry store(Mail m)
                            throws SavingException
stores a mail in this folder

Parameters:
m -
Returns:
Throws:
SavingException

equals

public boolean equals(MailArchive.Folder f)
two folder equal, if their directory equals

Parameters:
f -
Returns:

initFolder

public void initFolder()
loads the folder into their ram-representation


getFolder

public MailArchive.Folder getFolder(int i)

getIndex

public int getIndex(MailArchive.Folder f)

numFolder

public int numFolder()

getMail

public MailArchive.MailEntry getMail(int i)

getIndex

public int getIndex(MailArchive.MailEntry me)

numMails

public int numMails()