| org.columba.mail.folder.AbstractFolder org.columba.mail.folder.AbstractMessageFolder
All known Subclasses: org.columba.mail.folder.AbstractRemoteFolder, org.columba.mail.folder.virtual.VirtualFolder, org.columba.mail.folder.AbstractLocalFolder, org.columba.mail.folder.temp.TempFolder,
AbstractMessageFolder | abstract public class AbstractMessageFolder extends AbstractFolder implements IMailbox(Code) | | Abstract Basic AbstractMessageFolder class. It is subclassed by every folder
class containing messages and therefore offering methods to alter the
mailbox.
Folders are plugins and therefore dynamically created. This should make it
easy to write new folders in the future.
To make it very easy to add new local mailbox formats, we added a slightly
more complex class hierachy in org.columba.mail.folder,
org.columba.mail.folder.headercache. An implementation example can be found
in org.columba.mail.folder.mh.
Please note, that you only need to implement
DataStorageInstance which should be trivial in most cases. Then create a class extending
AbstractLocalFolder and plug your datastorage in this folder in
overwriting getDataStorageInstance() method.
Last, don't forget to register your folder plugin:
Add your folder to org.columba.mail.plugin.folder.xml . This
way you create an association of the folder name and the class which gets
loaded.
Edit your tree.xml file and replace the MH mailbox implementation with yours.
author: freddy |
Method Summary | |
protected InputStream | decodeStream(MimeHeader header, InputStream bodyStream) | public boolean | exists(Object uid) | public void | expungeFolder() | public void | fireMessageAdded(Object uid, Flags flags) Propagates an event to all registered listeners notifying them of a
message addition. | public void | fireMessageFlagChanged(Object uid, Flags oldFlags, int variant) Propagates an event to all registered listeners notifying them of a
message removal. | public void | fireMessageRemoved(Object uid, Flags flags) Propagates an event to all registered listeners notifying them of a
message removal. | public Object | getAttribute(Object uid, String key) | public Attributes | getAttributes(Object uid) | public File | getDirectoryFile() | public IFilterList | getFilterList() Method getFilterList. | public Flags | getFlags(Object uid) | abstract public IHeaderList | getHeaderList() | public Object | getLastSelection() Returns the last selected Message for the current folder. | public IMailboxInfo | getMessageFolderInfo() Method getMessageFolderInfo. | public IStatusObservable | getObservable() | public DefaultSearchEngine | getSearchEngine() | public Object[] | getUids() | protected boolean | hasChanged() Check if folder was modified.
boolean True, if folder data changed. | public boolean | isInboxFolder() Returns true if this folder is an Inbox folder. | public boolean | isReadOnly() | public boolean | isTrashFolder() Returns true if this folder is the Trash folder. | protected void | loadMessageFolderInfo() | protected void | markMessage(Object uid, int variant) | public void | markMessage(Object[] uids, int variant) | protected void | recreateMessageFolderInfo() | public void | removeMessage(Object uid) Remove message from folder.
author: : fdietz This method was intentionally changed to public also it author: isn't accessed from outside. | public void | save() | protected void | saveMessageFolderInfo() | public Object[] | searchMessages(IFilter filter, Object[] uids) | public Object[] | searchMessages(IFilter filter) | public void | setAttribute(Object uid, String key, Object value) | public void | setChanged(boolean b) Call this method if folder data changed, so that we know if we have to
save the header cache. | public void | setLastSelection(Object lastSel) Sets the last selection for the current folder. | public void | setMessageFolderInfo(MailboxInfo i) | public void | setSearchEngine(DefaultSearchEngine engine) | public boolean | supportsAddMessage() | public String | toString() | protected void | updateMailFolderInfo(Flags flags, int variant) |
changed | protected boolean changed(Code) | | set changed to true if the folder data changes.
|
directoryFile | protected File directoryFile(Code) | | directory where this folders files are stored
|
lastSelection | protected Object lastSelection(Code) | | The last selected uid for the current folder. This information is used to
show the last selected message, if you switch to the current folder and
the lastSelection field is set. If the lastSelection field is null, the
first message in the table for this folder is shown. Have a look to
org.columba.mail.gui.table.TableController#showHeaderList
|
messageFolderInfo | protected IMailboxInfo messageFolderInfo(Code) | | total/unread/recent count of messages in this folder
|
observable | protected IStatusObservable observable(Code) | | Status information updates are handled in using IStatusObservable.
Every command has to register its interest to this events before
accessing the folder.
|
AbstractMessageFolder | public AbstractMessageFolder(FolderItem item, String path)(Code) | | Standard constructor.
Parameters: item - FolderItem contains information about thefolder |
AbstractMessageFolder | protected AbstractMessageFolder()(Code) | | |
decodeStream | protected InputStream decodeStream(MimeHeader header, InputStream bodyStream)(Code) | | TODO (@author fdietz): move this out-of-folder!
Parameters: header - Parameters: bodyStream - |
fireMessageAdded | public void fireMessageAdded(Object uid, Flags flags)(Code) | | Propagates an event to all registered listeners notifying them of a
message addition.
Parameters: flags - |
fireMessageFlagChanged | public void fireMessageFlagChanged(Object uid, Flags oldFlags, int variant)(Code) | | Propagates an event to all registered listeners notifying them of a
message removal.
|
fireMessageRemoved | public void fireMessageRemoved(Object uid, Flags flags)(Code) | | Propagates an event to all registered listeners notifying them of a
message removal.
|
getDirectoryFile | public File getDirectoryFile()(Code) | | Returns the directory where the messages are saved
File the file representing the mailbox directory |
getFilterList | public IFilterList getFilterList()(Code) | | Method getFilterList.
FilterList |
getLastSelection | public Object getLastSelection()(Code) | | Returns the last selected Message for the current folder. If no message
was selected, it returns null. The return-value is the uid of the last
selected message.
|
getMessageFolderInfo | public IMailboxInfo getMessageFolderInfo()(Code) | | Method getMessageFolderInfo.
MessageFolderInfo |
hasChanged | protected boolean hasChanged()(Code) | | Check if folder was modified.
boolean True, if folder data changed. False, otherwise. |
isInboxFolder | public boolean isInboxFolder()(Code) | | Returns true if this folder is an Inbox folder.
true if this folder is an Inbox folder. |
isTrashFolder | public boolean isTrashFolder()(Code) | | Returns true if this folder is the Trash folder.
true if this folder is the Trash folder. |
loadMessageFolderInfo | protected void loadMessageFolderInfo()(Code) | | get messagefolderinfo from xml-configuration
|
markMessage | protected void markMessage(Object uid, int variant) throws Exception(Code) | | Parameters: uid - Parameters: variant - Parameters: worker - throws: Exception - |
recreateMessageFolderInfo | protected void recreateMessageFolderInfo()(Code) | | |
removeMessage | public void removeMessage(Object uid) throws Exception(Code) | | Remove message from folder.
author: : fdietz This method was intentionally changed to public also it author: isn't accessed from outside. This is why it isn't found in author: IMailbox. Only the VirtualFolder uses this public call. Parameters: uid - UID identifying the message to remove throws: Exception - |
save | public void save() throws Exception(Code) | | use this method to save folder meta-data when closing Columba
|
saveMessageFolderInfo | protected void saveMessageFolderInfo()(Code) | | save messagefolderinfo to xml-configuration
|
setChanged | public void setChanged(boolean b)(Code) | | Call this method if folder data changed, so that we know if we have to
save the header cache.
Parameters: b - |
setLastSelection | public void setLastSelection(Object lastSel)(Code) | | Sets the last selection for the current folder. This should be the uid of
the last selected Message for the current folder.
|
setMessageFolderInfo | public void setMessageFolderInfo(MailboxInfo i)(Code) | | Change the MessageFolderInfo
Parameters: i - the new messagefolderinfo |
setSearchEngine | public void setSearchEngine(DefaultSearchEngine engine)(Code) | | Set new search engine
See Also: org.columba.mail.folder.search Parameters: engine - new search engine |
supportsAddMessage | public boolean supportsAddMessage()(Code) | | See Also: org.columba.mail.folder.FolderTreeNode.supportsAddMessage |
updateMailFolderInfo | protected void updateMailFolderInfo(Flags flags, int variant) throws Exception(Code) | | |
|
|