|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.mail.Folder
gnu.mail.providers.imap.IMAPFolder
public class IMAPFolder
The folder class implementing the IMAP4rev1 mail protocol.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface javax.mail.UIDFolder |
|---|
UIDFolder.FetchProfileItem |
| Field Summary | |
|---|---|
protected char |
delimiter
|
protected int |
messageCount
|
protected int |
newMessageCount
|
protected String |
path
The folder path. |
protected Flags |
permanentFlags
|
protected boolean |
subscribed
|
protected int |
type
The type of this folder (HOLDS_MESSAGES or HOLDS_FOLDERS). |
protected long |
uidValidity
|
| Fields inherited from class javax.mail.Folder |
|---|
HOLDS_FOLDERS, HOLDS_MESSAGES, mode, READ_ONLY, READ_WRITE, store |
| Fields inherited from interface javax.mail.UIDFolder |
|---|
LASTUID |
| Constructor Summary | |
|---|---|
protected |
IMAPFolder(Store store,
String path)
Constructor. |
protected |
IMAPFolder(Store store,
String path,
char delimiter)
Constructor. |
protected |
IMAPFolder(Store store,
String path,
int type,
char delimiter)
Constructor. |
| Method Summary | |
|---|---|
void |
addACL(ACL ace)
Deprecated. this API will probably change incompatibly soon |
void |
addRights(ACL ace)
Deprecated. this API will probably change incompatibly soon |
void |
appendMessages(Message[] messages)
Appends the specified set of messages to this folder. |
void |
close(boolean expunge)
Closes this folder. |
boolean |
create(int type)
Create this folder. |
boolean |
delete(boolean flag)
Delete this folder. |
boolean |
equals(Object other)
|
boolean |
exists()
Indicates whether this folder exists. |
Message[] |
expunge()
Expunges this folder. |
void |
fetch(Message[] messages,
FetchProfile fp)
IMAP fetch routine. |
ACL[] |
getACL()
Deprecated. this API will probably change incompatibly soon |
int |
getDeletedMessageCount()
Returns the number of deleted messages in this folder. |
Folder |
getFolder(String name)
Returns a subfolder with the specified name. |
String |
getFullName()
Returns the full path of this folder. |
Message |
getMessage(int msgnum)
Returns the specified message number from this folder. |
Message |
getMessageByUID(long uid)
Returns the message corresponding to the given UID, or null if no such message exists. |
int |
getMessageCount()
Returns the number of messages in this folder. |
int |
getMessageCountByCriteria(String criteria)
Convenience method for returning the number of messages in the current folder that match the single criteria. |
Message[] |
getMessagesByUID(long[] uids)
Returns the messages specified by the given UIDs. |
Message[] |
getMessagesByUID(long start,
long end)
Returns the messages in the given range. |
String |
getName()
Returns the name of this folder. |
int |
getNewMessageCount()
Returns the number of new messages in this folder. |
Folder |
getParent()
Returns the parent folder of this folder. |
Flags |
getPermanentFlags()
Returns the permanent flags for this folder. |
Quota[] |
getQuota()
Returns the quotas for this folder. |
char |
getSeparator()
Returns the path separator charcter. |
int |
getType()
Returns the type of this folder. |
long |
getUID(Message message)
Returns the UID for the specified message. |
long |
getUIDValidity()
Returns the UIDValidity value associated with this folder. |
int |
getUnreadMessageCount()
Returns the number of unread messages in this folder. |
boolean |
hasNewMessages()
Indicates whether this folder contains new messages. |
boolean |
isOpen()
Indicates whether this folder is open. |
boolean |
isSubscribed()
Indicates whether this folder is subscribed. |
Folder[] |
list(String pattern)
Returns the subfolders for this folder. |
Rights |
listRights(String name)
Deprecated. this API will probably change incompatibly soon |
Folder[] |
listSubscribed(String pattern)
Returns the subscribed subfolders for this folder. |
Rights |
myRights()
Deprecated. this API will probably change incompatibly soon |
void |
open(int mode)
Opens this folder. |
void |
removeACL(String name)
Deprecated. this API will probably change incompatibly soon |
void |
removeRights(ACL ace)
Deprecated. this API will probably change incompatibly soon |
boolean |
renameTo(Folder folder)
Rename this folder. |
Message[] |
search(SearchTerm term)
IMAP search function. |
Message[] |
search(SearchTerm term,
Message[] msgs)
IMAP search function. |
void |
setSubscribed(boolean flag)
Subscribe to or unsubscribe from this folder. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String path
protected int type
protected Flags permanentFlags
protected char delimiter
protected int messageCount
protected int newMessageCount
protected long uidValidity
protected boolean subscribed
| Constructor Detail |
|---|
protected IMAPFolder(Store store,
String path)
protected IMAPFolder(Store store,
String path,
char delimiter)
protected IMAPFolder(Store store,
String path,
int type,
char delimiter)
| Method Detail |
|---|
public String getName()
getName in class Folderpublic String getFullName()
getFullName in class Folder
public int getType()
throws MessagingException
getType in class FolderMessagingException - if a messaging error occurred
public boolean exists()
throws MessagingException
exists in class FolderMessagingException - if a messaging error occurred
public boolean hasNewMessages()
throws MessagingException
hasNewMessages in class FolderMessagingException - if a messaging error occurred
public void open(int mode)
throws MessagingException
open in class Foldermode - open the Folder READ_ONLY or READ_WRITE
MessagingException - if a messaging error occurred
public boolean create(int type)
throws MessagingException
create in class Foldertype - the desired type of the folder
MessagingException
public boolean delete(boolean flag)
throws MessagingException
delete in class Folderflag - delete any subfolders
FolderNotFoundException - if this folder does not exist
MessagingException
public boolean renameTo(Folder folder)
throws MessagingException
renameTo in class Folderfolder - a folder representing the new name for this folder
FolderNotFoundException - if this folder does not exist
MessagingException
public void close(boolean expunge)
throws MessagingException
close in class Folderexpunge - if the folder is to be expunged before it is closed
MessagingException - if a messaging error occurred
public Message[] expunge()
throws MessagingException
expunge in class FolderMessagingException - if a messaging error occurredpublic boolean isOpen()
isOpen in class Folderpublic Flags getPermanentFlags()
getPermanentFlags in class Folder
public int getMessageCount()
throws MessagingException
getMessageCount in class FolderMessagingException - if a messaging error occurred
public int getNewMessageCount()
throws MessagingException
getNewMessageCount in class FolderMessagingException - if a messaging error occurred
public Message getMessage(int msgnum)
throws MessagingException
getMessage in class Foldermsgnum - the message number
MessagingException - if a messaging error occurred
public void appendMessages(Message[] messages)
throws MessagingException
MimeMessages are accepted.
appendMessages in class Foldermessages - array of messages to be appended
FolderNotFoundException - if this folder does not exist
MessagingException - if the append operation failed
public void fetch(Message[] messages,
FetchProfile fp)
throws MessagingException
fetch in class Foldermessages - the messages to fetch the items forfp - the fetch profile
MessagingException
public Message[] search(SearchTerm term)
throws MessagingException
search in class Folderterm - the search term
FolderNotFoundException - if this folder does not exist
MessagingException
public Message[] search(SearchTerm term,
Message[] msgs)
throws MessagingException
search in class Folderterm - the search termmsgs - the messages to be searched
MessagingExceptionpublic boolean isSubscribed()
FolderThis method can be invoked on a closed folder.
isSubscribed in class Folder
public void setSubscribed(boolean flag)
throws MessagingException
FolderThis method can be invoked on a closed folder.
setSubscribed in class FolderMessagingException
public Folder[] list(String pattern)
throws MessagingException
list in class Folderpattern - the match pattern
MessagingException
public Folder[] listSubscribed(String pattern)
throws MessagingException
listSubscribed in class Folderpattern - the match pattern
MessagingException
public Folder getParent()
throws MessagingException
getParent in class FolderMessagingException
public Folder getFolder(String name)
throws MessagingException
getFolder in class Foldername - the name of the folder
MessagingException
public char getSeparator()
throws MessagingException
getSeparator in class FolderMessagingExceptionpublic boolean equals(Object other)
equals in class Object
public long getUIDValidity()
throws MessagingException
UIDFolderA client should compare this value against a UIDValidity value saved from a previous session to ensure that any cached UIDs are valid.
getUIDValidity in interface UIDFolderMessagingException
public Message getMessageByUID(long uid)
throws MessagingException
UIDFoldernull if no such message exists.
getMessageByUID in interface UIDFolderuid - the UID of the desired message
MessagingException
public Message[] getMessagesByUID(long start,
long end)
throws MessagingException
UIDFolderend parameter
to indicate the last available UID.
getMessagesByUID in interface UIDFolderstart - the start UIDend - the end UID
MessagingException
public Message[] getMessagesByUID(long[] uids)
throws MessagingException
UIDFoldernull is returned for that entry.
The returned array will be of the same size as the specified UIDs.
getMessagesByUID in interface UIDFolderuids - the UIDs
MessagingException
public long getUID(Message message)
throws MessagingException
UIDFolder
getUID in interface UIDFoldermessage - a message in this folder
MessagingException
public Quota[] getQuota()
throws MessagingException
MessagingException
public int getUnreadMessageCount()
throws MessagingException
getUnreadMessageCount in class FolderMessagingExceptionFolder.getUnreadMessageCount()
public int getDeletedMessageCount()
throws MessagingException
getDeletedMessageCount in class FolderFolderNotFoundException - if this folder does not exist
MessagingExceptionFolder.getDeletedMessageCount()
public int getMessageCountByCriteria(String criteria)
throws MessagingException
MessagingException
public ACL[] getACL()
throws MessagingException
MessagingException
public void addACL(ACL ace)
throws MessagingException
ace - the access control entry
MessagingException
public void removeACL(String name)
throws MessagingException
name - the name of the principal
MessagingException
public void addRights(ACL ace)
throws MessagingException
ace - the access control entry
MessagingException
public void removeRights(ACL ace)
throws MessagingException
ace - the access control entry
MessagingException
public Rights listRights(String name)
throws MessagingException
name - the name of the principal
MessagingException
public Rights myRights()
throws MessagingException
MessagingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||