The folder class implementing the IMAP4rev1 mail protocol.
delimiter
protected char delimiter
messageCount
protected int messageCount
newMessageCount
protected int newMessageCount
path
protected String path
The folder path.
permanentFlags
protected Flags permanentFlags
subscribed
protected boolean subscribed
type
protected int type
The type of this folder(HOLDS_MESSAGES or HOLDS_FOLDERS).
uidValidity
protected long uidValidity
IMAPFolder
protected IMAPFolder(Store store,
String path)
Constructor.
IMAPFolder
protected IMAPFolder(Store store,
String path,
char delimiter)
Constructor.
IMAPFolder
protected IMAPFolder(Store store,
String path,
int type,
char delimiter)
Constructor.
appendMessages
public void appendMessages(Message messages)
throws MessagingException
Appends the specified set of messages to this folder.
Only MimeMessage
s are accepted.
- appendMessages in interface Folder
close
public void close(boolean expunge)
throws MessagingException
Closes this folder.
- close in interface Folder
expunge
- if the folder is to be expunged before it is closed
MessagingException
- if a messaging error occurred
equals
public boolean equals(Object other)
fetch
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.
- fetch in interface Folder
getFullName
public String getFullName()
Returns the full path of this folder.
- getFullName in interface Folder
getMessage
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.
- getMessage in interface Folder
MessagingException
- if a messaging error occurred
getMessageCountByCriteria
public int getMessageCountByCriteria(String criteria)
throws MessagingException
Convenience method for returning the number of messages in the
current folder that match the single criteria.
getMessagesByUID
public Message[] getMessagesByUID(long start,
long end)
throws MessagingException
Returns the messages in the given range.
The special value LASTUID can be used as the end
parameter
to indicate the last available UID.
- getMessagesByUID in interface UIDFolder
start
- the start UIDend
- the end UID
getMessagesByUID
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.
- getMessagesByUID in interface UIDFolder
uids
- the UIDs
getName
public String getName()
Returns the name of this folder.
- getName in interface Folder
getNewMessageCount
public int getNewMessageCount()
throws MessagingException
Returns the number of new messages in this folder.
- getNewMessageCount in interface Folder
MessagingException
- if a messaging error occurred
getPermanentFlags
public Flags getPermanentFlags()
Returns the permanent flags for this folder.
- getPermanentFlags in interface Folder
getQuota
public Quota[] getQuota()
throws MessagingException
Returns the quotas for this folder.
getSeparator
public char getSeparator()
throws MessagingException
Returns the path separator charcter.
- getSeparator in interface Folder
getUIDValidity
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.
- getUIDValidity in interface UIDFolder
isOpen
public boolean isOpen()
Indicates whether this folder is open.
- isOpen in interface Folder
isSubscribed
public boolean isSubscribed()
Indicates whether this folder is subscribed.
This method can be invoked on a closed folder.
- isSubscribed in interface Folder
listSubscribed
public Folder[] listSubscribed(String pattern)
throws MessagingException
Returns the subscribed subfolders for this folder.
- listSubscribed in interface Folder
setSubscribed
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.
- setSubscribed in interface Folder