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, toString
public java.lang.String getName()
Folder
This method can be invoked on a closed folder.
public java.lang.String getFullName()
Folder
This method can be invoked on a closed folder.
getFullName
in class Folder
public Folder[] list(java.lang.String pattern) throws MessagingException
list
in class Folder
pattern
- the JavaMail patternMessagingException
public Folder[] list(ListFolderListener listener) throws MessagingException
listener
- the listener to be called as soon as a new folder is
listedMessagingException
public 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 knownMessagingException
public Folder[] listSubscribed(java.lang.String pattern) throws MessagingException
listSubscribed
in class Folder
pattern
- the JavaMail patternMessagingException
public Folder getFolder(java.lang.String name) throws MessagingException
getFolder
in class Folder
name
- the name of the folderMessagingException
public Folder getParent() throws MessagingException
Folder
null
if this folder is the root of a folder hierarchy.
This method can be invoked on a closed folder.
getParent
in class Folder
MessagingException
public boolean exists() throws MessagingException
Folder
This method can be invoked on a closed folder.
exists
in class Folder
MessagingException
public char getSeparator() throws MessagingException
getSeparator
in class Folder
MessagingException
public int getType()
public void open(int mode) throws MessagingException
Folder
open
in class Folder
mode
- open the Folder READ_ONLY or READ_WRITEFolderNotFoundException
- if this folder does not existMessagingException
public void close(boolean expunge) throws MessagingException
Folder
close
in class Folder
expunge
- if true, expunge all deleted messagesMessagingException
public Message[] expunge() throws MessagingException
Folder
Expunge 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 Folder
FolderNotFoundException
- if this folder does not existMessagingException
public boolean isOpen()
Folder
public Flags getPermanentFlags()
Folder
getPermanentFlags
in class Folder
public int getMessageCount() throws MessagingException
Folder
This 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 Folder
MessagingException
public Message getMessage(int msgnum) throws MessagingException
Folder
Note 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 Folder
msgnum
- the message numberFolderNotFoundException
- if this folder does not existMessagingException
public void setSubscribed(boolean flag) throws MessagingException
setSubscribed
in class Folder
MessagingException
public boolean hasNewMessages() throws MessagingException
Folder
This method can be invoked on a closed folder that can contain messages.
hasNewMessages
in class Folder
MessagingException
public void appendMessages(Message[] messages) throws MessagingException
Folder
This method can be invoked on a closed folder.
appendMessages
in class Folder
messages
- array of messages to be appendedFolderNotFoundException
- if this folder does not existMessagingException
- if the append operation failedpublic boolean create(int type) throws MessagingException
Folder
If the creation is successful, a CREATED FolderEvent is delivered to any FolderListeners registered on this Folder and this Store.
create
in class Folder
type
- the desired type of the folderMessagingException
public boolean delete(boolean flag) throws MessagingException
Folder
delete
in class Folder
flag
- delete any subfoldersFolderNotFoundException
- if this folder does not existMessagingException
public boolean renameTo(Folder folder) throws MessagingException
Folder
renameTo
in class Folder
folder
- a folder representing the new name for this folderFolderNotFoundException
- if this folder does not existMessagingException