|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.fortuna.mstor.connector.AbstractFolderDelegate<MessageDelegate>
net.fortuna.mstor.connector.mbox.MboxFolder
public class MboxFolder
$Id$ Created on 30/07/2007
Constructor Summary | |
---|---|
MboxFolder(java.io.File file)
|
Method Summary | |
---|---|
void |
appendMessages(javax.mail.Message[] messages)
Append the specified messages to this delegate. |
void |
close()
Close the folder delegate. |
boolean |
create(int type)
Initialise the delegate based on the specified folder type. |
protected MessageDelegate |
createMessage(int messageNumber)
|
boolean |
delete()
Delete the folder delegate. |
boolean |
exists()
Indicates whether the folder represented by this delegate exists. |
void |
expunge(javax.mail.Message[] deleted)
Permanently delete the specified messages from this delegate. |
FolderDelegate<MessageDelegate> |
getFolder(java.lang.String name)
Returns a child folder delegate with the specified name. |
java.lang.String |
getFolderName()
|
java.lang.String |
getFullName()
|
long |
getLastModified()
Returns the last modification timestamp of this folder. |
long |
getLastUid()
Retrieves the last allocated message UID for the folder. |
MessageDelegate |
getMessage(int messageNumber)
Returns message delegate corresponding to the specified message id. |
java.io.InputStream |
getMessageAsStream(int index)
Returns an input stream from which to read the specified message. |
int |
getMessageCount()
Returns the number of messages in the folder delegate. |
FolderDelegate<MessageDelegate> |
getParent()
|
char |
getSeparator()
|
int |
getType()
|
long |
getUidValidity()
Returns the UID validity associated with the metadata. |
FolderDelegate<MessageDelegate>[] |
list(java.lang.String pattern)
Returns a list of child folder delegates matching the specified pattern. |
void |
open(int mode)
Open the folder delegate. |
boolean |
renameTo(java.lang.String name)
Rename the folder delegate. |
protected void |
setLastUid(long uid)
|
Methods inherited from class net.fortuna.mstor.connector.AbstractFolderDelegate |
---|
allocateUid, getDeletedMessageCount |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MboxFolder(java.io.File file)
file
- an mbox data fileMethod Detail |
---|
public final int getType()
Folder.HOLDS_FOLDERS
,
Folder.HOLDS_MESSAGES
public final java.lang.String getFolderName()
public final java.lang.String getFullName()
public final FolderDelegate<MessageDelegate> getParent()
public final FolderDelegate<MessageDelegate> getFolder(java.lang.String name)
name
- a folder name
public final FolderDelegate<MessageDelegate>[] list(java.lang.String pattern)
pattern
- a pattern to match folders against
public final boolean exists()
public final boolean delete()
public final boolean renameTo(java.lang.String name)
name
- the new folder name
public final void open(int mode)
mode
- the mode to open the folderFolder.READ_ONLY
,
Folder.READ_WRITE
public final void close() throws javax.mail.MessagingException
javax.mail.MessagingException
- where an unexpected error occurs closing the folderpublic final char getSeparator()
public final int getMessageCount() throws javax.mail.MessagingException
javax.mail.MessagingException
- where an unexpected error occurs retrieving the message countpublic final java.io.InputStream getMessageAsStream(int index) throws java.io.IOException
index
- the index of the message to return
java.io.IOException
- where an error occurspublic final void appendMessages(javax.mail.Message[] messages) throws javax.mail.MessagingException
messages
- an array of messages to append to the folder
javax.mail.MessagingException
- where an error occurs appending the messagespublic final boolean create(int type) throws javax.mail.MessagingException
type
- a folder type
javax.mail.MessagingException
- where an unexpected error occurs creating the delegatepublic final void expunge(javax.mail.Message[] deleted) throws javax.mail.MessagingException
deleted
- an array of deleted messages to expunge
javax.mail.MessagingException
- where an error occurs expunging the messagesprotected MessageDelegate createMessage(int messageNumber) throws DelegateException
createMessage
in class AbstractFolderDelegate<MessageDelegate>
messageNumber
- the message number to associate with the new message
DelegateException
- where an error occurs creating the delegatepublic MessageDelegate getMessage(int messageNumber) throws DelegateException
messageNumber
- the message number of the message to retrieve
DelegateException
- where an error occurs retrieving the messageprotected void setLastUid(long uid) throws java.lang.UnsupportedOperationException
setLastUid
in class AbstractFolderDelegate<MessageDelegate>
uid
- the latest UID for the folder
java.lang.UnsupportedOperationException
- if this method is not supported in the folder delegatepublic long getLastUid() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- if this method is not supported by the folder implementationpublic long getUidValidity() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- if this method is not supported by the folder implementationpublic long getLastModified() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- if this method is not supported by the folder implementation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |