|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Store
Represents a message store and its access protocol, for storing and retrieving messages on the device
Field Summary | |
---|---|
static java.lang.String |
DRAFTS
|
static java.lang.String |
INBOX
|
static java.lang.String |
OUTBOX
|
static java.lang.String |
SENT
|
static java.lang.String |
TRASH
|
Method Summary | |
---|---|
int |
countMessages(java.lang.String path)
This method returns the message count in this Store. |
Folder |
createFolder(java.lang.String path)
Creates a Folder in this Store with the provided path |
Folder[] |
findFolders(java.lang.String path)
Retrieves a Folder in this Store that matches the provided substring |
Folder |
getFolder(java.lang.String path)
Retrieves a Folder by name |
java.lang.String[] |
getMessageIDs(java.lang.String path)
This method returns the messageIDs of all the messages in the folder path . |
Message[] |
getMsgHeaders(java.lang.String path)
This method reads the headers of all the message from a folder. |
void |
init(boolean reset)
Initialize the message store, creating the main folders. |
Folder[] |
list()
Retrieves a list of folders directly under this Store |
Folder[] |
list(java.lang.String path)
This method returns the list of the folders whose path starts with 'path' and are direct subfolders of it. |
Message |
readMessage(java.lang.String path,
java.lang.String msgid)
This method reads a message from the Store, using the message Id. |
boolean |
removeFolder(java.lang.String path)
Removes a folder from the record store. |
void |
removeMessage(java.lang.String path,
java.lang.String messageID)
This method removes a Message from the Store, using message ID as index. |
void |
saveMessage(java.lang.String path,
Message msg)
This method saves a message in the Store |
Field Detail |
---|
static final java.lang.String INBOX
static final java.lang.String OUTBOX
static final java.lang.String DRAFTS
static final java.lang.String SENT
static final java.lang.String TRASH
Method Detail |
---|
void init(boolean reset) throws StoreException
reset
- if true, erase and re-create all the main folders.
StoreException
Folder[] list()
null
if the store is empty.Folder[] list(java.lang.String path) throws StoreException
path
- the path of the parent folder
null
if
path
has no subfolders.
StoreException
- If the path is not validFolder createFolder(java.lang.String path) throws StoreException
path
- the full path of the folder in the Store.
StoreException
- If an error occurs on the store (e.g. no space left)boolean removeFolder(java.lang.String path) throws StoreException
path
- The full pathname in the Store
true
if the folder has been actually deleted,
false
if the folder did not exist.
StoreException
- if an error occurs on the storeFolder getFolder(java.lang.String path) throws StoreException
path
- The path to the Folder in the device's file system
StoreException
- If an error occurs accessing the StoreFolder[] findFolders(java.lang.String path)
path
- The partial path in the device's file system to the searched
Folder
null
if there are no matchesMessage[] getMsgHeaders(java.lang.String path) throws StoreException
path
- The complete path of the Folder
containing the
messages.
Message
with all the headers
set but without content
StoreException
- If an error occurs accessing the Storejava.lang.String[] getMessageIDs(java.lang.String path) throws StoreException
path
.
path
- the complete path of the folder
null
if the folder is
empty.
StoreException
- If an error occurs accessing the StoreMessage readMessage(java.lang.String path, java.lang.String msgid) throws StoreException
path
- The complete path of the Folder
containing the
Message
.msgid
- A string representing the unique message ID
Message
corresponding to the passed path and
message ID from this Store
StoreException
- If an error occurs accessing the Storevoid saveMessage(java.lang.String path, Message msg) throws StoreException
path
- The complete path of the Folder
containing the
Message
.msg
- The Message
to save.
StoreException
- If an error occurs accessing the Storevoid removeMessage(java.lang.String path, java.lang.String messageID) throws StoreException
path
- The complete path of the Folder
containing the
Message
.messageID
- A string representing the unique message ID
StoreException
- If an error occurs accessing the Storeint countMessages(java.lang.String path) throws StoreException
path
- The complete path of the Folder
containing the
Message
.
StoreException
- If an error occurs accessing the Store
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |