Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.mail.Folder
gnu.mail.providers.imap.IMAPFolder
Field Summary | |
protected char | |
protected int | |
protected int | |
protected String |
|
protected Flags | |
protected boolean | |
protected int |
|
protected long |
Fields inherited from class javax.mail.Folder | |
HOLDS_FOLDERS , HOLDS_MESSAGES , READ_ONLY , READ_WRITE , mode , store |
Constructor Summary | |
| |
| |
|
Method Summary | |
void | |
void | |
void |
|
void |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
Message[] |
|
void |
|
ACL[] |
|
int |
|
Folder |
|
String |
|
Message |
|
Message |
|
int |
|
int |
|
Message[] |
|
Message[] |
|
String |
|
int |
|
Folder |
|
Flags |
|
Quota[] |
|
char |
|
int |
|
long | |
long |
|
int |
|
boolean |
|
boolean |
|
boolean |
|
Folder[] |
|
Rights |
|
Folder[] |
|
Rights |
|
void |
|
void |
|
void |
|
boolean | |
Message[] |
|
Message[] |
|
void |
|
protected char delimiter
protected int messageCount
protected int newMessageCount
protected String path
The folder path.
protected boolean subscribed
protected int type
The type of this folder (HOLDS_MESSAGES or HOLDS_FOLDERS).
protected long uidValidity
public void addACL(ACL ace) throws MessagingException
Deprecated. this API will probably change incompatibly soon
Adds the specified access control entry to this folder.
- Parameters:
ace
- the access control entry
public void addRights(ACL ace) throws MessagingException
Deprecated. this API will probably change incompatibly soon
Adds the rights for the specified access control entry.
- Parameters:
ace
- the access control entry
public void appendMessages(Message[] messages) throws MessagingException
Appends the specified set of messages to this folder. OnlyMimeMessage
s are accepted.
- Overrides:
- appendMessages in interface Folder
public void close(boolean expunge) throws MessagingException
Closes this folder.
- Parameters:
expunge
- if the folder is to be expunged before it is closed
- Throws:
MessagingException
- if a messaging error occurred
public boolean equals(Object other)
public boolean exists() throws MessagingException
Indicates whether this folder exists.
- Throws:
MessagingException
- if a messaging error occurred
public Message[] expunge() throws MessagingException
Expunges this folder. This deletes all the messages marked as deleted.
- Throws:
MessagingException
- if a messaging error occurred
public void fetch(Message[] messages, FetchProfile fp) throws MessagingException
IMAP fetch routine. This executes the fetch for the specified message numbers and updates the messages according to the message statuses returned.
public ACL[] getACL() throws MessagingException
Deprecated. this API will probably change incompatibly soon
Returns the access control list for this folder. This is an array of access control entries.
public int getDeletedMessageCount() throws MessagingException
Returns the number of deleted messages in this folder.
- Overrides:
- getDeletedMessageCount in interface Folder
- See Also:
Folder.getDeletedMessageCount()
public Folder getFolder(String name) throws MessagingException
Returns a subfolder with the specified name.
public String getFullName()
Returns the full path of this folder.
- Overrides:
- getFullName in interface Folder
public Message getMessage(int msgnum) throws MessagingException
Returns the specified message number from this folder. The message is only retrieved once from the server. Subsequent getMessage() calls to the same message are cached. Since POP3 does not provide a mechanism for retrieving only part of the message(headers, etc), the entire message is retrieved.
- Overrides:
- getMessage in interface Folder
- Throws:
MessagingException
- if a messaging error occurred
public Message getMessageByUID(long uid) throws MessagingException
Returns the message corresponding to the given UID, ornull
if no such message exists.
- Specified by:
- getMessageByUID in interface UIDFolder
- Parameters:
uid
- the UID of the desired message
public int getMessageCount() throws MessagingException
Returns the number of messages in this folder.
- Overrides:
- getMessageCount in interface Folder
- Throws:
MessagingException
- if a messaging error occurred
public int getMessageCountByCriteria(String criteria) throws MessagingException
Convenience method for returning the number of messages in the current folder that match the single criteria.
public Message[] getMessagesByUID(long start, long end) throws MessagingException
Returns the messages in the given range. The special value LASTUID can be used as theend
parameter to indicate the last available UID.
- Specified by:
- getMessagesByUID in interface UIDFolder
- Parameters:
start
- the start UIDend
- the end UID
public Message[] getMessagesByUID(long[] uids) throws MessagingException
Returns the messages specified by the given UIDs. If any UID is invalid,null
is returned for that entry. The returned array will be of the same size as the specified UIDs.
- Specified by:
- getMessagesByUID in interface UIDFolder
- Parameters:
uids
- the UIDs
public String getName()
Returns the name of this folder.
public int getNewMessageCount() throws MessagingException
Returns the number of new messages in this folder.
- Overrides:
- getNewMessageCount in interface Folder
- Throws:
MessagingException
- if a messaging error occurred
public Folder getParent() throws MessagingException
Returns the parent folder of this folder.
public Flags getPermanentFlags()
Returns the permanent flags for this folder.
- Overrides:
- getPermanentFlags in interface Folder
public char getSeparator() throws MessagingException
Returns the path separator charcter.
- Overrides:
- getSeparator in interface Folder
public int getType() throws MessagingException
Returns the type of this folder.
- Throws:
MessagingException
- if a messaging error occurred
public long getUID(Message message) throws MessagingException
Returns the UID for the specified message.
- Parameters:
message
- a message in this folder
public long getUIDValidity() throws MessagingException
Returns the UIDValidity value associated with this folder. A client should compare this value against a UIDValidity value saved from a previous session to ensure that any cached UIDs are valid.
- Specified by:
- getUIDValidity in interface UIDFolder
public int getUnreadMessageCount() throws MessagingException
Returns the number of unread messages in this folder.
- Overrides:
- getUnreadMessageCount in interface Folder
- See Also:
Folder.getUnreadMessageCount()
public boolean hasNewMessages() throws MessagingException
Indicates 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.
public boolean isSubscribed()
Indicates whether this folder is subscribed. This method can be invoked on a closed folder.
- Overrides:
- isSubscribed in interface Folder
public Folder[] list(String pattern) throws MessagingException
Returns the subfolders for this folder.
public Rights listRights(String name) throws MessagingException
Deprecated. this API will probably change incompatibly soon
Returns the rights currently assigned to the given principal.
- Parameters:
name
- the name of the principal
public Folder[] listSubscribed(String pattern) throws MessagingException
Returns the subscribed subfolders for this folder.
- Overrides:
- listSubscribed in interface Folder
public Rights myRights() throws MessagingException
Deprecated. this API will probably change incompatibly soon
Returns the rights assigned to the currently authenticated principal.
public void open(int mode) throws MessagingException
Opens this folder.
- Throws:
MessagingException
- if a messaging error occurred
public void removeACL(String name) throws MessagingException
Deprecated. this API will probably change incompatibly soon
Removes the ACL for the given principal.
- Parameters:
name
- the name of the principal
public void removeRights(ACL ace) throws MessagingException
Deprecated. this API will probably change incompatibly soon
Removes the rights specified in the given access control entry from the principal.
- Parameters:
ace
- the access control entry
public Message[] search(SearchTerm term, Message[] msgs) throws MessagingException
IMAP search function.
public void setSubscribed(boolean flag) throws MessagingException
Subscribe to or unsubscribe from this folder. Not all Stores support subscription. This method can be invoked on a closed folder.
- Overrides:
- setSubscribed in interface Folder