|
||||||||||||
| 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
The folder class implementing the IMAP4rev1 mail protocol.
| Nested Class Summary |
|---|
| Nested classes inherited from class javax.mail.UIDFolder |
|---|
UIDFolder.FetchProfileItem |
| Field Summary | |
|---|---|
protected char |
delimiter
|
protected int |
messageCount
|
protected int |
newMessageCount
|
protected java.lang.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,
java.lang.String path)
Constructor. |
protected |
IMAPFolder(Store store,
java.lang.String path,
char delimiter)
Constructor. |
protected |
IMAPFolder(Store store,
java.lang.String path,
int type,
char delimiter)
Constructor. |
| Method Summary | |
|---|---|
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(java.lang.Object other)
|
boolean |
exists()
Indicates whether this folder exists. |
Message[] |
expunge()
Expunges this folder. |
void |
fetch(Message[] messages,
FetchProfile fp)
IMAP fetch routine. |
int |
getDeletedMessageCount()
Returns the number of deleted messages in this folder. |
Folder |
getFolder(java.lang.String name)
Returns a subfolder with the specified name. |
java.lang.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(java.lang.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. |
java.lang.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. |
org.jpackage.mail.inet.imap.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(java.lang.String pattern)
Returns the subfolders for this folder. |
Folder[] |
listSubscribed(java.lang.String pattern)
Returns the subscribed subfolders for this folder. |
void |
open(int mode)
Opens this folder. |
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 java.lang.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,
java.lang.String path)
protected IMAPFolder(Store store,
java.lang.String path,
char delimiter)
protected IMAPFolder(Store store,
java.lang.String path,
int type,
char delimiter)
| Method Detail |
public java.lang.String getName()
getName in class Folderpublic java.lang.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
MessagingException
public boolean renameTo(Folder folder)
throws MessagingException
renameTo in class Folderfolder - a folder representing the new name for this folder
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
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
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(java.lang.String pattern)
throws MessagingException
list in class Folderpattern - the match pattern
MessagingException
public Folder[] listSubscribed(java.lang.String pattern)
throws MessagingException
listSubscribed in class Folderpattern - the match pattern
MessagingException
public Folder getParent()
throws MessagingException
getParent in class FolderMessagingException
public Folder getFolder(java.lang.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(java.lang.Object other)
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 org.jpackage.mail.inet.imap.Quota[] getQuota()
throws MessagingException
MessagingException
public int getUnreadMessageCount()
throws MessagingException
getUnreadMessageCount in class FolderMessagingExceptionFolder.getUnreadMessageCount()
public int getDeletedMessageCount()
throws MessagingException
getDeletedMessageCount in class FolderMessagingExceptionFolder.getDeletedMessageCount()
public int getMessageCountByCriteria(java.lang.String criteria)
throws MessagingException
MessagingException
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||