gnu.mail.providers.maildir

Class MaildirFolder

public final class MaildirFolder extends Folder

The folder class implementing a Maildir-format mailbox.

Author: Chris Burdess

Constructor Summary
protected MaildirFolder(Store store, String filename, boolean root, boolean inbox)
Constructor.
protected MaildirFolder(Store store, String filename)
Constructor.
Method Summary
voidappendMessages(Message[] m)
Appends messages to this folder.
voidclose(boolean expunge)
Closes this folder.
booleancreate(int type)
Creates this folder in the store.
booleandelete(boolean recurse)
Deletes this folder.
booleanexists()
Indicates whether this folder exists.
Message[]expunge()
Expunges this folder.
FoldergetFolder(String filename)
Returns the subfolder of this folder with the specified name.
StringgetFullName()
Returns the full name of this folder.
MessagegetMessage(int msgnum)
Returns the specified message number from this folder.
intgetMessageCount()
Returns the number of messages in this folder.
Message[]getMessages()
Returns the messages in this folder.
StringgetName()
Returns the name of this folder.
intgetNewMessageCount()
Returns the number of new messages in this folder.
FoldergetParent()
Returns the parent folder.
FlagsgetPermanentFlags()
Returns the permanent flags for this folder.
chargetSeparator()
Returns the separator character.
intgetType()
Returns the type of this folder.
URLNamegetURLName()
Return a URLName representing this folder.
booleanhasNewMessages()
Indicates whether this folder contains new messages.
booleanisOpen()
Indicates whether this folder is open.
Folder[]list()
Returns the subfolders of this folder.
Folder[]list(String pattern)
Returns the subfolders of this folder matching the specified pattern.
voidopen(int mode)
Opens this folder.
booleanrenameTo(Folder folder)
Renames this folder.

Constructor Detail

MaildirFolder

protected MaildirFolder(Store store, String filename, boolean root, boolean inbox)
Constructor.

MaildirFolder

protected MaildirFolder(Store store, String filename)
Constructor.

Method Detail

appendMessages

public void appendMessages(Message[] m)
Appends messages to this folder. Only MimeMessages within the array will be appended, as we don't know how to retrieve internet content for other kinds.

Parameters: m an array of messages to be appended

close

public void close(boolean expunge)
Closes this folder.

Parameters: expunge if the folder is to be expunged before it is closed

Throws: MessagingException if a messaging error occurred

create

public boolean create(int type)
Creates this folder in the store.

delete

public boolean delete(boolean recurse)
Deletes this folder.

exists

public boolean exists()
Indicates whether this folder exists.

Throws: MessagingException if a messaging error occurred

expunge

public Message[] expunge()
Expunges this folder. This deletes all the messages marked as deleted.

Throws: MessagingException if a messaging error occurred

getFolder

public Folder getFolder(String filename)
Returns the subfolder of this folder with the specified name.

getFullName

public String getFullName()
Returns the full name of this folder.

getMessage

public Message getMessage(int msgnum)
Returns the specified message number from this folder.

Throws: MessagingException if a messaging error occurred

getMessageCount

public int getMessageCount()
Returns the number of messages in this folder.

Throws: MessagingException if a messaging error occurred

getMessages

public Message[] getMessages()
Returns the messages in this folder.

Throws: MessagingException if a messaging error occurred

getName

public String getName()
Returns the name of this folder.

getNewMessageCount

public int getNewMessageCount()
Returns the number of new messages in this folder.

Throws: MessagingException if a messaging error occurred

getParent

public Folder getParent()
Returns the parent folder.

getPermanentFlags

public Flags getPermanentFlags()
Returns the permanent flags for this folder.

getSeparator

public char getSeparator()
Returns the separator character.

getType

public int getType()
Returns the type of this folder.

Throws: MessagingException if a messaging error occurred

getURLName

public URLName getURLName()
Return a URLName representing this folder.

hasNewMessages

public boolean hasNewMessages()
Indicates whether this folder contains new messages.

Throws: MessagingException if a messaging error occurred

isOpen

public boolean isOpen()
Indicates whether this folder is open.

list

public Folder[] list()
Returns the subfolders of this folder.

list

public Folder[] list(String pattern)
Returns the subfolders of this folder matching the specified pattern.

open

public void open(int mode)
Opens this folder. If the folder is opened for writing, a lock must be acquired on the mbox. If this fails a MessagingException is thrown.

Throws: MessagingException if a messaging error occurred

renameTo

public boolean renameTo(Folder folder)
Renames this folder.
©