|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectFolder
com.knowgate.hipermail.DBFolder
public class DBFolder
A subclass of javax.mail.Folder providing storage for MimeMessages at database LONGVARBINARY columns and MBOX files.
Folders are also a subclass of com.knowgate.hipergate.Category
| Field Summary | |
|---|---|
static short |
ClassId
|
static int |
MODE_BLOB
|
static int |
MODE_MBOX
|
| Constructor Summary | |
|---|---|
protected |
DBFolder(Store oStor,
java.lang.String sName)
|
| Method Summary | |
|---|---|
java.lang.String |
appendMessage(MimeMessage oMsg)
|
void |
appendMessages(Message[] msgs)
Append messages to this DBFolder |
void |
close(boolean expunge)
Close this folder |
java.lang.String |
copyMessage(DBMimeMessage oSrcMsg)
Copy a DBMimeMessage from another DBFolder to this DBFolder |
boolean |
create(int type)
This method is not implemented and will always raise UnsupportedOperationException |
boolean |
create(java.lang.String sFolderName)
Create DBFolder with given name under current user mailroot Category |
boolean |
delete(boolean recurse)
Wipe all messages and delete this folder |
boolean |
exists()
|
Message[] |
expunge()
Expunge deleted messages This method removes from the database and the MBOX file those messages flagged as deleted at k_mime_msgs table |
Category |
getCategory()
Get instance of com.knowgate.hipergate.Category object |
java.lang.String |
getCategoryGuid()
Get Category GUID Each folder has a Global Unique Identifier which is stored at column gu_category of table k_categories |
protected JDCConnection |
getConnection()
|
java.lang.String |
getDirectoryPath()
Get path to directory containing files belonging to this folder |
java.io.File |
getFile()
Get MBOX file that holds messages for this DBFolder |
java.lang.String |
getFilePath()
Get full path to MBOX file containing mime messages |
Folder |
getFolder(java.lang.String name)
Get folder by name or GUID |
java.lang.String |
getFullName()
Get category subpath to directory holding MBOX files for this folder The category path is composed by concatenating the names of all the parent folders separated by a slash. |
Message |
getMessage(int msgnum)
|
protected Message |
getMessage(java.lang.String sMsgId,
int IdType)
|
DBMimeMessage |
getMessageByGuid(java.lang.String sMsgGuid)
|
DBMimeMessage |
getMessageByID(java.lang.String sMsgId)
|
int |
getMessageCount()
|
java.util.Properties |
getMessageHeaders(java.lang.String sMsgId)
Get message GUID, Id, Number, Subject, From and Reply-To from k_mime_msgs table This method is mainly used for testing whether or not a message is already present at current folder. |
java.lang.String |
getName()
Get column nm_category from table k_categories for this folder |
Folder |
getParent()
|
Flags |
getPermanentFlags()
|
char |
getSeparator()
|
int |
getType()
|
URLName |
getURLName()
|
boolean |
hasNewMessages()
This method is not implemented and will always raise UnsupportedOperationException |
int |
importMbox(java.lang.String sMboxFilePath)
|
boolean |
isOpen()
|
DBKeySet |
keySet()
Get set of identifiers for messages at this folder Set entries are the mime identifiers for each message |
Folder[] |
list(java.lang.String pattern)
|
java.lang.String[] |
listMessages()
Get a list of all messages in this folder which are not deleted |
void |
moveMessage(DBMimeMessage oSrcMsg)
Move a DBMimeMessage from another DBFolder to this DBFolder |
void |
open(int mode)
Open this DBFolder |
void |
reindexMbox()
Delete very message from th eindex and rebuild it by reading the default MBOX file for this folder |
void |
reindexMbox(java.lang.String sMboxFilePath)
Delete every message from the index and rebuild it by re-reading the specified MBOX file |
boolean |
renameTo(Folder f)
|
void |
wipe()
Delete all messages from this folder and clear MBOX file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MODE_MBOX
public static final int MODE_BLOB
public static final short ClassId
| Constructor Detail |
|---|
protected DBFolder(Store oStor,
java.lang.String sName)
| Method Detail |
|---|
protected JDCConnection getConnection()
throws java.sql.SQLException,
MessagingException
java.sql.SQLException
MessagingExceptionpublic Category getCategory()
public java.lang.String getCategoryGuid()
Get Category GUID
Each folder has a Global Unique Identifier which is stored at column gu_category of table k_categories
public DBKeySet keySet()
throws java.sql.SQLException
Get set of identifiers for messages at this folder
Set entries are the mime identifiers for each message
java.sql.SQLException
public void appendMessages(Message[] msgs)
throws MessagingException,
java.lang.ArrayIndexOutOfBoundsException
msgs - Array of mime messages to be appended
MessagingException
java.lang.ArrayIndexOutOfBoundsException
public java.lang.String copyMessage(DBMimeMessage oSrcMsg)
throws MessagingException
oSrcMsg - Source message.
MessagingException
public void moveMessage(DBMimeMessage oSrcMsg)
throws MessagingException
oSrcMsg - Source message
MessagingException
public boolean create(int type)
throws MessagingException
java.lang.UnsupportedOperationException
MessagingException
public boolean create(java.lang.String sFolderName)
throws MessagingException
sFolderName - Folder Name
MessagingException
public void open(int mode)
throws MessagingException
mode - {READ_ONLY|READ_WRITE}
MessagingException
public void close(boolean expunge)
throws MessagingException
expunge -
MessagingException
public boolean delete(boolean recurse)
throws MessagingException
recurse - boolean
MessagingException
public Folder getFolder(java.lang.String name)
throws MessagingException
name - String Folder name or GUID
MessagingException
public boolean hasNewMessages()
throws MessagingException
java.lang.UnsupportedOperationException
MessagingException
public boolean renameTo(Folder f)
throws MessagingException,
StoreClosedException,
java.lang.NullPointerException
MessagingException
StoreClosedException
java.lang.NullPointerException
public boolean exists()
throws MessagingException,
StoreClosedException
MessagingException
StoreClosedException
public Message[] expunge()
throws MessagingException
Expunge deleted messages
This method removes from the database and the MBOX file those messages flagged as deleted at k_mime_msgs table
MessagingException
public void wipe()
throws MessagingException
MessagingExceptionpublic java.lang.String getFullName()
Get category subpath to directory holding MBOX files for this folder
The category path is composed by concatenating the names of all the parent folders separated by a slash. The name of a folder is stored at column nm_category of table k_categories
public java.lang.String getDirectoryPath()
public java.lang.String getFilePath()
public java.io.File getFile()
public java.lang.String getName()
public URLName getURLName()
throws MessagingException,
StoreClosedException
MessagingException
StoreClosedException
protected Message getMessage(java.lang.String sMsgId,
int IdType)
throws MessagingException
MessagingException
public java.lang.String appendMessage(MimeMessage oMsg)
throws FolderClosedException,
StoreClosedException,
MessagingException,
java.lang.ArrayIndexOutOfBoundsException,
java.lang.NullPointerException
oMsg - MimeMessage
FolderClosedException
StoreClosedException
MessagingException
java.lang.ArrayIndexOutOfBoundsException
java.lang.NullPointerException - if oMsg is null
public Message getMessage(int msgnum)
throws MessagingException
MessagingException
public DBMimeMessage getMessageByGuid(java.lang.String sMsgGuid)
throws MessagingException
MessagingException
public DBMimeMessage getMessageByID(java.lang.String sMsgId)
throws MessagingException
MessagingException
public int getMessageCount()
throws FolderClosedException,
MessagingException
FolderClosedException
MessagingException
public Folder getParent()
throws MessagingException
MessagingExceptionpublic Flags getPermanentFlags()
public char getSeparator()
throws MessagingException
MessagingException
public Folder[] list(java.lang.String pattern)
throws MessagingException
MessagingException
public java.lang.String[] listMessages()
throws java.sql.SQLException,
MessagingException
Get a list of all messages in this folder which are not deleted
java.sql.SQLException
MessagingException
public int getType()
throws MessagingException
MessagingExceptionpublic boolean isOpen()
public java.util.Properties getMessageHeaders(java.lang.String sMsgId)
throws FolderClosedException,
java.sql.SQLException
Get message GUID, Id, Number, Subject, From and Reply-To from k_mime_msgs table
This method is mainly used for testing whether or not a message is already present at current folder.
sMsgId - String GUID or Id of message to be rerieved
FolderClosedException
java.sql.SQLException
public int importMbox(java.lang.String sMboxFilePath)
throws java.io.FileNotFoundException,
java.io.IOException,
MessagingException
java.io.FileNotFoundException
java.io.IOException
MessagingException
public void reindexMbox(java.lang.String sMboxFilePath)
throws java.io.FileNotFoundException,
java.io.IOException,
MessagingException,
java.sql.SQLException
sMboxFilePath - String Full path to MBOX file
java.io.FileNotFoundException
java.io.IOException
MessagingException
java.sql.SQLException
public void reindexMbox()
throws java.io.FileNotFoundException,
java.io.IOException,
MessagingException,
java.sql.SQLException
java.io.FileNotFoundException
java.io.IOException
MessagingException
java.sql.SQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||