public final class NNTPRootFolder extends Folder
HOLDS_FOLDERS, HOLDS_MESSAGES, mode, READ_ONLY, READ_WRITE, store| Modifier and Type | Method and Description |
|---|---|
void |
appendMessages(Message[] messages)
Appends the specified messages to this folder.
|
void |
close(boolean expunge)
Closes this folder.
|
boolean |
create(int type)
Create this folder in the store.
|
boolean |
delete(boolean flag)
Deletes this folder.
|
boolean |
exists()
Indicates whether this folder exists in the Store.
|
Message[] |
expunge()
Expunges (permanently removing) all the messages marked DELETED.
|
Folder |
getFolder(java.lang.String name)
Returns a new Folder object associated with the specified name.
|
java.lang.String |
getFullName()
Returns the full name of this folder.
|
Message |
getMessage(int msgnum)
Returns the message with the given number.
|
int |
getMessageCount()
Returns the number of messages in this folder.
|
java.lang.String |
getName()
Returns the name of this folder.
|
Folder |
getParent()
Returns the parent folder of this folder, or
null
if this folder is the root of a folder hierarchy. |
Flags |
getPermanentFlags()
Returns the permanent flags supported by this folder.
|
char |
getSeparator()
As we're dealing with a flat namespace, the value of this is
irrelevant.
|
int |
getType()
This folder contains only folders.
|
boolean |
hasNewMessages()
Indicates whether this folder has new messages.
|
boolean |
isOpen()
Indicates whether this folder is open.
|
Folder[] |
list(ListFolderListener listener)
Returns the list of folders matching the specified pattern.
|
Folder[] |
list(java.lang.String pattern)
Returns the list of folders matching the specified pattern.
|
Folder[] |
list(java.lang.String pattern,
ListFolderListener listener)
Returns the list of folders matching the specified pattern.
|
Folder[] |
listSubscribed(java.lang.String pattern)
Returns the list of subscribed folders matching the specified pattern.
|
void |
open(int mode)
Opens this folder.
|
boolean |
renameTo(Folder folder)
Renames this folder.
|
void |
setSubscribed(boolean flag)
This folder is always "subscribed".
|
addConnectionListener, addFolderListener, addMessageChangedListener, addMessageCountListener, copyMessages, fetch, getDeletedMessageCount, getMessages, getMessages, getMessages, getMode, getNewMessageCount, getStore, getUnreadMessageCount, getURLName, isSubscribed, list, listSubscribed, notifyConnectionListeners, notifyFolderListeners, notifyFolderRenamedListeners, notifyMessageAddedListeners, notifyMessageChangedListeners, notifyMessageRemovedListeners, removeConnectionListener, removeFolderListener, removeMessageChangedListener, removeMessageCountListener, search, search, setFlags, setFlags, setFlags, toStringpublic java.lang.String getName()
FolderThis method can be invoked on a closed folder.
public java.lang.String getFullName()
FolderThis method can be invoked on a closed folder.
getFullName in class Folderpublic Folder[] list(java.lang.String pattern) throws MessagingException
list in class Folderpattern - the JavaMail patternMessagingExceptionpublic Folder[] list(ListFolderListener listener) throws MessagingException
listener - the listener to be called as soon as a new folder is
listedMessagingExceptionpublic Folder[] list(java.lang.String pattern, ListFolderListener listener) throws MessagingException
pattern - the JavaMail patternlistener - the listener that will be called for each folder name
as soon as it is knownMessagingExceptionpublic Folder[] listSubscribed(java.lang.String pattern) throws MessagingException
listSubscribed in class Folderpattern - the JavaMail patternMessagingExceptionpublic Folder getFolder(java.lang.String name) throws MessagingException
getFolder in class Foldername - the name of the folderMessagingExceptionpublic Folder getParent() throws MessagingException
Foldernull
if this folder is the root of a folder hierarchy.
This method can be invoked on a closed folder.
getParent in class FolderMessagingExceptionpublic boolean exists()
throws MessagingException
FolderThis method can be invoked on a closed folder.
exists in class FolderMessagingExceptionpublic char getSeparator()
throws MessagingException
getSeparator in class FolderMessagingExceptionpublic int getType()
public void open(int mode)
throws MessagingException
Folderopen in class Foldermode - open the Folder READ_ONLY or READ_WRITEFolderNotFoundException - if this folder does not existMessagingExceptionpublic void close(boolean expunge)
throws MessagingException
Folderclose in class Folderexpunge - if true, expunge all deleted messagesMessagingExceptionpublic Message[] expunge() throws MessagingException
FolderExpunge causes the renumbering of any messages with numbers higher than the message number of the lowest-numbered expunged message.
After a message has been expunged, only the isExpunged and
getMessageNumber methods are still valid on the
corresponding Message object; other methods may throw
MessageRemovedException.
expunge in class FolderFolderNotFoundException - if this folder does not existMessagingExceptionpublic boolean isOpen()
Folderpublic Flags getPermanentFlags()
FoldergetPermanentFlags in class Folderpublic int getMessageCount()
throws MessagingException
FolderThis method can be invoked on a closed folder; however, note that for some stores, getting the message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose to return -1 here when the folder is closed.
getMessageCount in class FolderMessagingExceptionpublic Message getMessage(int msgnum) throws MessagingException
FolderNote that message numbers can change within a session if the folder is expunged, therefore the use of message numbers as references to messages is inadvisable.
getMessage in class Foldermsgnum - the message numberFolderNotFoundException - if this folder does not existMessagingExceptionpublic void setSubscribed(boolean flag)
throws MessagingException
setSubscribed in class FolderMessagingExceptionpublic boolean hasNewMessages()
throws MessagingException
FolderThis method can be invoked on a closed folder that can contain messages.
hasNewMessages in class FolderMessagingExceptionpublic void appendMessages(Message[] messages) throws MessagingException
FolderThis method can be invoked on a closed folder.
appendMessages in class Foldermessages - array of messages to be appendedFolderNotFoundException - if this folder does not existMessagingException - if the append operation failedpublic boolean create(int type)
throws MessagingException
FolderIf the creation is successful, a CREATED FolderEvent is delivered to any FolderListeners registered on this Folder and this Store.
create in class Foldertype - the desired type of the folderMessagingExceptionpublic boolean delete(boolean flag)
throws MessagingException
Folderdelete in class Folderflag - delete any subfoldersFolderNotFoundException - if this folder does not existMessagingExceptionpublic boolean renameTo(Folder folder) throws MessagingException
FolderrenameTo in class Folderfolder - a folder representing the new name for this folderFolderNotFoundException - if this folder does not existMessagingException