⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
gnu.mail.providers.maildir

Class MaildirFolder

java.lang.Object
|
+--javax.mail.Folder
   |
   +--gnu.mail.providers.maildir.MaildirFolder


public final class MaildirFolder
extends Folder

The folder class implementing a Maildir-format mailbox.
Author:

Constructor Summary

MaildirFolder(Store store, String filename, boolean root, boolean inbox)

Constructor.

MaildirFolder(Store store, String filename)

Constructor.

Method Summary

synchronized void

appendMessages(Message m)

Appends messages to this folder.

void

close(boolean expunge)

Closes this folder.

boolean

create(int type)

Creates this folder in the store.

boolean

delete(boolean recurse)

Deletes this folder.

boolean

exists()

Indicates whether this folder exists.

Message[]

expunge()

Expunges this folder.

Folder

getFolder(String filename)

Returns the subfolder of this folder with the specified name.

String

getFullName()

Returns the full name of this folder.

synchronized Message

getMessage(int msgnum)

Returns the specified message number from this folder.

synchronized int

getMessageCount()

Returns the number of messages in this folder.

synchronized Message[]

getMessages()

Returns the messages in this folder.

String

getName()

Returns the name of this folder.

synchronized int

getNewMessageCount()

Returns the number of new messages in this folder.

Folder

getParent()

Returns the parent folder.

Flags

getPermanentFlags()

Returns the permanent flags for this folder.

char

getSeparator()

Returns the separator character.

int

getType()

Returns the type of this folder.

URLName

getURLName()

Return a URLName representing this folder.

boolean

hasNewMessages()

Indicates whether this folder contains new messages.

boolean

isOpen()

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.

void

open(int mode)

Opens this folder.

boolean

renameTo(Folder folder)

Renames this folder.

Constructor Details

MaildirFolder

protected MaildirFolder(Store store, String filename)

Constructor.

Parameters:
store
filename

MaildirFolder

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

Constructor.

Parameters:
store
filename
root
inbox

Method Details

appendMessages

public synchronized 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.

Parameters:
type

delete

public boolean delete(boolean recurse)

Deletes this folder.

Parameters:
recurse

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.

Parameters:
filename

getFullName

public String getFullName()

Returns the full name of this folder.


getMessage

public synchronized Message getMessage(int msgnum)

Returns the specified message number from this folder.

Parameters:
msgnum
Throws:
MessagingException - if a messaging error occurred

getMessageCount

public synchronized int getMessageCount()

Returns the number of messages in this folder.

Throws:
MessagingException - if a messaging error occurred

getMessages

public synchronized 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 synchronized 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.

Parameters:
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.

Parameters:
mode
Throws:
MessagingException - if a messaging error occurred

renameTo

public boolean renameTo(Folder folder)

Renames this folder.

Parameters:
folder