public class MboxFolder extends Folder
HOLDS_FOLDERS, HOLDS_MESSAGES, mode, READ_ONLY, READ_WRITE, store
Modifier | Constructor and Description |
---|---|
protected |
MboxFolder(Store store,
java.io.File file,
boolean inbox)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acquireLock()
Locks this mailbox.
|
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.
|
static java.lang.String |
decodeFrom(java.lang.String line)
Returns the specified line with any From_ line encoding removed.
|
boolean |
delete(boolean recurse)
Deletes this folder.
|
boolean |
exists()
Indicates whether this folder exists.
|
Message[] |
expunge()
Expunges this folder.
|
protected java.lang.String |
fromLine(MboxMessage message)
Returns the From_ line for the specified mbox message.
|
Folder |
getFolder(java.lang.String name)
Returns the subfolder of this folder with the specified name.
|
java.lang.String |
getFullName()
Returns the full name of this folder.
|
Message |
getMessage(int msgnum)
Returns the specified message number from this folder.
|
int |
getMessageCount()
Returns the number of messages in this folder.
|
Message[] |
getMessages()
Returns the messages in this folder.
|
java.lang.String |
getName()
Returns the name of 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(java.lang.String pattern)
Returns the subfolders of this folder matching the specified pattern.
|
void |
open(int mode)
Opens this folder.
|
boolean |
releaseLock()
Unlocks this mailbox.
|
boolean |
renameTo(Folder folder)
Renames this folder.
|
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, copyMessages, fetch, getDeletedMessageCount, getMessages, getMessages, getMode, getNewMessageCount, getStore, getUnreadMessageCount, isSubscribed, listSubscribed, listSubscribed, notifyConnectionListeners, notifyFolderListeners, notifyFolderRenamedListeners, notifyMessageAddedListeners, notifyMessageChangedListeners, notifyMessageRemovedListeners, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, search, search, setFlags, setFlags, setFlags, setSubscribed, toString
protected MboxFolder(Store store, java.io.File file, boolean inbox)
public java.lang.String getName()
public java.lang.String getFullName()
getFullName
in class Folder
public URLName getURLName() throws MessagingException
getURLName
in class Folder
MessagingException
public int getType() throws MessagingException
getType
in class Folder
MessagingException
- if a messaging error occurredpublic boolean exists() throws MessagingException
exists
in class Folder
MessagingException
- if a messaging error occurredpublic boolean hasNewMessages() throws MessagingException
hasNewMessages
in class Folder
MessagingException
- if a messaging error occurredpublic void open(int mode) throws MessagingException
open
in class Folder
mode
- open the Folder READ_ONLY or READ_WRITEMessagingException
- if a messaging error occurredpublic static java.lang.String decodeFrom(java.lang.String line)
public void close(boolean expunge) throws MessagingException
close
in class Folder
expunge
- if the folder is to be expunged before it is closedMessagingException
- if a messaging error occurredprotected java.lang.String fromLine(MboxMessage message) throws MessagingException
MessagingException
public Message[] expunge() throws MessagingException
expunge
in class Folder
MessagingException
- if a messaging error occurredpublic boolean isOpen()
public Flags getPermanentFlags()
getPermanentFlags
in class Folder
public int getMessageCount() throws MessagingException
getMessageCount
in class Folder
MessagingException
- if a messaging error occurredpublic Message getMessage(int msgnum) throws MessagingException
getMessage
in class Folder
msgnum
- the message numberMessagingException
- if a messaging error occurredpublic Message[] getMessages() throws MessagingException
getMessages
in class Folder
MessagingException
- if a messaging error occurredpublic void appendMessages(Message[] m) throws MessagingException
appendMessages
in class Folder
m
- an array of messages to be appendedFolderNotFoundException
- if this folder does not existMessagingException
- if the append operation failedpublic Folder getParent() throws MessagingException
getParent
in class Folder
MessagingException
public Folder[] list() throws MessagingException
list
in class Folder
MessagingException
public Folder[] list(java.lang.String pattern) throws MessagingException
list
in class Folder
pattern
- the match patternMessagingException
public char getSeparator() throws MessagingException
getSeparator
in class Folder
MessagingException
public boolean create(int type) throws MessagingException
create
in class Folder
type
- the desired type of the folderMessagingException
public boolean delete(boolean recurse) throws MessagingException
delete
in class Folder
recurse
- delete any subfoldersFolderNotFoundException
- if this folder does not existMessagingException
public boolean renameTo(Folder folder) throws MessagingException
renameTo
in class Folder
folder
- a folder representing the new name for this folderFolderNotFoundException
- if this folder does not existMessagingException
public Folder getFolder(java.lang.String name) throws MessagingException
getFolder
in class Folder
name
- the name of the folderMessagingException
public boolean acquireLock()
public boolean releaseLock()