| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectjavax.mail.Foldergnu.mail.providers.mbox.MboxFolderpublic class MboxFolderextends FolderField Summary |
Fields inherited from class javax.mail.Folder | |
HOLDS_FOLDERS, HOLDS_MESSAGES, READ_ONLY, READ_WRITE, mode, store | |
Constructor Summary | |
| |
| |
Method Summary | |
boolean |
|
void |
|
void |
|
boolean |
|
static String |
|
boolean |
|
boolean |
|
Message[] |
|
protected String |
|
Folder |
|
String |
|
Message |
|
int |
|
Message[] |
|
String |
|
Folder |
|
Flags |
|
char |
|
int |
|
URLName |
|
boolean |
|
boolean |
|
Folder[] |
|
Folder[] |
|
void |
|
boolean |
|
boolean | |
public boolean acquireLock()
Locks this mailbox. This uses a dotlock-like mechanism - see createNewFile(). If the directory containing the mbox folder is not writable, we will not be able to open the mbox for writing either.
public void appendMessages(Message m) throws MessagingException
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
public void close(boolean expunge)
throws MessagingExceptionCloses this folder.
- Overrides:
- close in interface Folder
- Parameters:
expunge- if the folder is to be expunged before it is closed
- Throws:
MessagingException- if a messaging error occurred
public boolean create(int type)
throws MessagingExceptionCreates this folder in the store.
- Overrides:
- create in interface Folder
public static String decodeFrom(String line)
Returns the specified line with any From_ line encoding removed.
public boolean delete(boolean recurse)
throws MessagingExceptionDeletes this folder.
- Overrides:
- delete in interface Folder
public boolean exists()
throws MessagingExceptionIndicates whether this folder exists.
- Overrides:
- exists in interface Folder
- Throws:
MessagingException- if a messaging error occurred
public Message[] expunge() throws MessagingException
Expunges this folder. This deletes all the messages marked as deleted.
- Overrides:
- expunge in interface Folder
- Throws:
MessagingException- if a messaging error occurred
protected String fromLine(MboxMessage message) throws MessagingException
Returns the From_ line for the specified mbox message. If this does not already exist (the message was appended to the folder since it was last opened), we will attempt to generate a suitable From_ line for it.
public Folder getFolder(String filename) throws MessagingException
Returns the subfolder of this folder with the specified name.
- Overrides:
- getFolder in interface Folder
public String getFullName()
Returns the full name of this folder.
- Overrides:
- getFullName in interface Folder
public Message getMessage(int msgnum) throws MessagingException
Returns the specified message number from this folder.
- Overrides:
- getMessage in interface Folder
- Throws:
MessagingException- if a messaging error occurred
public int getMessageCount()
throws MessagingExceptionReturns the number of messages in this folder.
- Overrides:
- getMessageCount in interface Folder
- Throws:
MessagingException- if a messaging error occurred
public Message[] getMessages() throws MessagingException
Returns the messages in this folder.
- Overrides:
- getMessages in interface Folder
- Throws:
MessagingException- if a messaging error occurred
public String getName()
Returns the name of this folder.
- Overrides:
- getName in interface Folder
public Folder getParent() throws MessagingException
Returns the parent folder.
- Overrides:
- getParent in interface Folder
public Flags getPermanentFlags()
Returns the permanent flags for this folder.
- Overrides:
- getPermanentFlags in interface Folder
public char getSeparator()
throws MessagingExceptionReturns the separator character.
- Overrides:
- getSeparator in interface Folder
public int getType()
throws MessagingExceptionReturns the type of this folder.
- Overrides:
- getType in interface Folder
- Throws:
MessagingException- if a messaging error occurred
public URLName getURLName() throws MessagingException
Return a URLName representing this folder.
- Overrides:
- getURLName in interface Folder
public boolean hasNewMessages()
throws MessagingExceptionIndicates whether this folder contains new messages.
- Overrides:
- hasNewMessages in interface Folder
- Throws:
MessagingException- if a messaging error occurred
public boolean isOpen()
Indicates whether this folder is open.
- Overrides:
- isOpen in interface Folder
public Folder[] list() throws MessagingException
Returns the subfolders of this folder.
- Overrides:
- list in interface Folder
public Folder[] list(String pattern) throws MessagingException
Returns the subfolders of this folder matching the specified pattern.
- Overrides:
- list in interface Folder
public void open(int mode)
throws MessagingExceptionOpens this folder. If the folder is opened for writing, a lock must be acquired on the mbox. If this fails a MessagingException is thrown.
- Overrides:
- open in interface Folder
- Throws:
MessagingException- if a messaging error occurred
public boolean releaseLock()
Unlocks this mailbox. This deletes any associated lockfile if it exists. It returns false if an existing lockfile could not be deleted.
public boolean renameTo(Folder folder) throws MessagingException
Renames this folder.
- Overrides:
- renameTo in interface Folder