|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.mail.Folder
public class Folder
Represents a mailbox folder on the device. Folders can contain
Message
objects, other Folder
objects or both.
This nesting capability enables a folder hierarchy for stored messages. The
different levels of hierarchy in a folder's full name are separated by the
hierarchy separator character, which you can retrieve using
getSeparator()
. You can retrieve a contained folder by name
using getFolder()
, or a list of contained folders by using
list()
Constructor Summary | |
---|---|
Folder(java.lang.String fullname,
Store store)
Constructs a new Folder providing a name for it and a
reference to the Store in which it has to be created |
Method Summary | |
---|---|
void |
appendMessage(Message msg)
Appends the given Message to this Folder |
void |
deleteMessage(int index)
Deletes a Message from this Folder , using
a positional index as key. |
void |
deleteMessage(Message msg)
Deletes a Message from this Folder |
void |
deleteMessage(java.lang.String msgid)
Deletes a Message from this Folder , using
the message id as key. |
Folder |
getFolder(java.lang.String name)
Returns the requested subfolder |
java.lang.String |
getFullName()
Returns the full name of this Folder as passed in the
constructor |
Message |
getMessage(int index)
Gets the Message object corresponding using a positional
index. |
Message |
getMessage(java.lang.String msgid)
Gets the Message object corresponding to the given message
ID |
int |
getMessageCount()
Get the total number of messages in this Folder |
Message[] |
getMsgHeaders()
This method returns the headers of all the messages in the folder path . |
java.lang.String |
getName()
Returns the name of this Folder , taking the last part of
the fullname |
Folder |
getParent()
Returns the parent Folder of this Folder |
char |
getSeparator()
Returns the delimiter character that separates this Folder 's
pathname from the names of immediate subfolders
TODO: Perhaps it is better to define in a field the character used as
separator and not directly here (this adopted here is the solution by
Sun) |
Store |
getStore()
Retrieves the Store containing this Folder |
Folder[] |
list()
This method returns the list of folders under this Folder |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Folder(java.lang.String fullname, Store store)
Folder
providing a name for it and a
reference to the Store
in which it has to be created
fullname
- The name for this Folder
store
- The Store
in which the folder has to be createdMethod Detail |
---|
public void appendMessage(Message msg) throws MailException
Message
to this Folder
MailException
public Message getMessage(java.lang.String msgid) throws MailException
Message
object corresponding to the given message
ID
MailException
public Message[] getMsgHeaders() throws MailException
path
.
Message
with all the headers
set but without content
MailException
- If an error occurs accessing the Storepublic Message getMessage(int index) throws MailException
Message
object corresponding using a positional
index.
The position starts from 1 and it is always referred to the messages
currently present in the folder. Deleting a message causes the index
to be shifted. This must be taken into account by calling methods.
The order in which the messages are ordered is not defined, and the
caller must not rely on it.
index
- the position of the message to retrieve
MailException
public void deleteMessage(Message msg) throws MailException
Message
from this Folder
msg
- A reference to the message to be deleted
MailException
public void deleteMessage(java.lang.String msgid) throws MailException
Message
from this Folder
, using
the message id as key.
msgid
- A reference to the message to be deleted
MailException
public void deleteMessage(int index) throws MailException
Message
from this Folder
, using
a positional index as key.
The position starts from 1 and it is always referred to the messages
currently present in the folder. Deleting a message causes the index
to be shifted. This must be taken into account by calling methods.
The order in which the messages are ordered is not defined, and the
caller must not rely on it.
index
- The index of the message to delete
MailException
public int getMessageCount() throws MailException
Folder
MailException
public Folder getParent() throws MailException
MailException
public char getSeparator()
Folder
's
pathname from the names of immediate subfolders
TODO: Perhaps it is better to define in a field the character used as
separator and not directly here (this adopted here is the solution by
Sun)
public Folder[] list() throws StoreException
StoreException
public Store getStore()
Store
containing this Folder
public java.lang.String getFullName()
Folder
as passed in the
constructor
Folder
public java.lang.String getName()
Folder
, taking the last part of
the fullname
Folder
public Folder getFolder(java.lang.String name) throws MailException
name
- The name of the subfolder
Folder
object representing the requested
subfolder
MailException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |