UIDFolder.FetchProfileItem
Modifier and Type | Field and Description |
---|---|
protected char |
delimiter |
protected int |
messageCount |
protected int |
newMessageCount |
protected java.lang.String |
path
The folder path.
|
protected Flags |
permanentFlags |
protected int |
type
The type of this folder (HOLDS_MESSAGES or HOLDS_FOLDERS).
|
protected long |
uidnext |
protected long |
uidvalidity |
protected int |
unreadMessageCount |
HOLDS_FOLDERS, HOLDS_MESSAGES, mode, READ_ONLY, READ_WRITE, store
Modifier | Constructor and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
appendMessages(Message[] messages)
Appends the specified set of messages to this folder.
|
void |
close(boolean expunge)
Closes this folder.
|
void |
copyMessages(Message[] msgs,
Folder folder)
Copies the specified messages into another 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.
|
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.
|
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, getMessages, getMessages, getMessages, getMode, getStore, getURLName, list, listSubscribed, notifyConnectionListeners, notifyFolderListeners, notifyFolderRenamedListeners, notifyMessageAddedListeners, notifyMessageChangedListeners, notifyMessageRemovedListeners, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, setFlags, setFlags, setFlags, toString
protected java.lang.String path
protected int type
protected Flags permanentFlags
protected char delimiter
protected int messageCount
protected int newMessageCount
protected int unreadMessageCount
protected long uidvalidity
protected long uidnext
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)
public java.lang.String getName()
public java.lang.String getFullName()
getFullName
in class Folder
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 boolean create(int type) throws MessagingException
create
in class Folder
type
- the desired type of the folderMessagingException
public boolean delete(boolean flag) throws MessagingException
delete
in class Folder
flag
- 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 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 occurredpublic 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 int getNewMessageCount() throws MessagingException
getNewMessageCount
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 void copyMessages(Message[] msgs, Folder folder) throws MessagingException
The destination folder does not have to be open.
copyMessages
in class Folder
msgs
- the messagesfolder
- the folder to copy the messages toMessagingException
public void appendMessages(Message[] messages) throws MessagingException
MimeMessage
s are accepted.appendMessages
in class Folder
messages
- array of messages to be appendedFolderNotFoundException
- if this folder does not existMessagingException
- if the append operation failedpublic void fetch(Message[] messages, FetchProfile fp) throws MessagingException
fetch
in class Folder
messages
- the messages to fetch the items forfp
- the fetch profileMessagingException
public Message[] search(SearchTerm term) throws MessagingException
search
in class Folder
term
- the search termFolderNotFoundException
- if this folder does not existMessagingException
public Message[] search(SearchTerm term, Message[] msgs) throws MessagingException
search
in class Folder
term
- the search termmsgs
- the messages to be searchedMessagingException
public boolean isSubscribed()
Folder
This method can be invoked on a closed folder.
isSubscribed
in class Folder
public void setSubscribed(boolean flag) throws MessagingException
Folder
This method can be invoked on a closed folder.
setSubscribed
in class Folder
MessagingException
public Folder[] list(java.lang.String pattern) throws MessagingException
list
in class Folder
pattern
- the match patternMessagingException
public Folder[] listSubscribed(java.lang.String pattern) throws MessagingException
listSubscribed
in class Folder
pattern
- the match patternMessagingException
public Folder getParent() throws MessagingException
getParent
in class Folder
MessagingException
public Folder getFolder(java.lang.String name) throws MessagingException
getFolder
in class Folder
name
- the name of the folderMessagingException
public char getSeparator() throws MessagingException
getSeparator
in class Folder
MessagingException
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public long getUIDValidity() throws MessagingException
UIDFolder
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
MessagingException
public Message getMessageByUID(long uid) throws MessagingException
UIDFolder
null
if no such message exists.getMessageByUID
in interface UIDFolder
uid
- the UID of the desired messageMessagingException
public Message[] getMessagesByUID(long start, long end) throws MessagingException
UIDFolder
end
parameter
to indicate the last available UID.getMessagesByUID
in interface UIDFolder
start
- the start UIDend
- the end UIDMessagingException
public Message[] getMessagesByUID(long[] uids) throws MessagingException
UIDFolder
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 UIDsMessagingException
public long getUID(Message message) throws MessagingException
UIDFolder
getUID
in interface UIDFolder
message
- a message in this folderMessagingException
public int getUnreadMessageCount() throws MessagingException
getUnreadMessageCount
in class Folder
MessagingException
Folder.getUnreadMessageCount()
public int getDeletedMessageCount() throws MessagingException
getDeletedMessageCount
in class Folder
FolderNotFoundException
- if this folder does not existMessagingException
Folder.getDeletedMessageCount()
public int getMessageCountByCriteria(java.lang.String criteria) throws MessagingException
MessagingException