All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----com.ibm.network.mail.base.Folder
'messages'
.
Folders are created using one of two forms of the factory method
createFolder()
.
The name of the folder can be any valid string. But three names represented by the
static constant attributes INBOX
, TRASH
and SENT
are reserved. INBOX
represents the default folder for all new messages.
TRASH
represents the folder where all the deleted messages are stored.
TRASH
can be emptied by using expunge()
. SENT
represents the folder where all the sent messages are stored.
When the folder is deserialized from the persistent stream, it contains a
list of SummaryHeader
s. Messages are retrieved from the folder
file only when user actually wants to see them. Once the message has been
retrieved, any subsequent request for displaying the message will be handled
by the SummaryHeader
directly without having to read it again
from the folder file.
Folder
.
Folder
with given folder name
and directory name.
Folder
with given folder name
and directory name and the file name which will contain messages.
Folder
.
close()
.
Folder
.
SummaryHeader
s in this folder.
public static final String INBOX
public static final String TRASH
public static final String SENT
public Folder()
Folder
.
This constructor is ONLY for Serialization/Deserialization and should not
be used by the developers.
public synchronized SummaryHeader addMessage(MimeMessage msg) throws IOException
public synchronized void close()
public static Folder createFolder(String folder, String directory)
Folder
with given folder name
and directory name. A file named 'messages' will be created under the
specified directory, if not already present. This file will hold the messages
in this Folder
. One more file with the name specified in
folder
parameter will be created under the directory specified in
directory
parameter. This file will
contain the SummaryHeader
objects for the messages in the
folder.
Folder
.
Folder
.
public static Folder createFolder(String folder, String directory, String file)
Folder
with given folder name
and directory name and the file name which will contain messages. A file with
the name specified in file
parameter will be created under the
specified directory, if not already present. This file will hold the messages
in this Folder
. One more file with the name specified in
folder
parameter will be created under the the directory specified in
directory
parameter. This file will
contain the SummaryHeader
objects for the messages in the
folder.
Folder
.
Folder
.
public synchronized void deleteAll()
public synchronized void deleteMessage(SummaryHeader hdr)
SummaryHeader
of the message to be deleted.
public synchronized void expunge()
Folder
.
public void finalize()
close()
.
public synchronized MimeMessage getMessage(SummaryHeader hdr)
Folder
reads the message from the folder file. Sets the message in
the hdr
using setMessage
in SummaryHeader
and returns the message.
SummaryHeader
identifying the MimeMessage
.
hdr
.
public String getName()
Folder
.
Folder
.
public synchronized Enumeration getSummaryHeaders()
SummaryHeader
s in this folder.
SummaryHeader
s in this folder
public static Vector list()
public synchronized void moveMessage(SummaryHeader header, Folder target)
SummaryHeader
.
public synchronized void open() throws IOException
public static void registerDeserializedFolder(Folder folder)
createFolder()
.
public synchronized void setDirectoryName(String directory)
All Packages Class Hierarchy This Package Previous Next Index