A JavaMail folder delegate for an NNTP newsgroup.
close
public void close(boolean expunge)
throws MessagingException
This method has no particular meaning in NNTP.
- close in interface Folder
delete
public boolean delete(boolean recurse)
throws MessagingException
NNTP servers are read-only.
- delete in interface Folder
exists
public boolean exists()
throws MessagingException
Indicates whether the newsgroup is present on the server.
- exists in interface Folder
getFolder
public Folder getFolder(String name)
throws MessagingException
This folder type does not contain other folders.
- getFolder in interface Folder
getFullName
public String getFullName()
- getFullName in interface Folder
getName()
getMessage
public Message getMessage(int msgnum)
throws MessagingException
Returns the article corresponding to the specified article
number.
- getMessage in interface Folder
getMessageCount
public int getMessageCount()
throws MessagingException
Returns the number of articles in this newsgroup.
- getMessageCount in interface Folder
getMessages
public Message[] getMessages()
throws MessagingException
Returns all articles in this group.
This tries XHDR first to retrieve Message-IDs for the articles.
If this fails we fall back to statting each article.
- getMessages in interface Folder
getMode
public int getMode()
This folder type is always read-only.
- getMode in interface Folder
getName
public String getName()
Returns the name of the newsgroup, e.g. alt.test
.
- getName in interface Folder
getParent
public Folder getParent()
throws MessagingException
This implementation uses a flat namespace, so the parent of any
NNTPFolder is the NNTP root folder.
- getParent in interface Folder
getPermanentFlags
public Flags getPermanentFlags()
Returns the flags supported by this folder.
- getPermanentFlags in interface Folder
getSeparator
public char getSeparator()
throws MessagingException
If we move away from a flat namespace, this might be useful.
- getSeparator in interface Folder
getType
public int getType()
throws MessagingException
Returns the type of this folder.
This folder type only holds messages.
- getType in interface Folder
hasNewMessages
public boolean hasNewMessages()
throws MessagingException
Indicates whether there are new articles in this newsgroup.
- hasNewMessages in interface Folder
isOpen
public boolean isOpen()
- isOpen in interface Folder
isSubscribed
public boolean isSubscribed()
Indicates if the newsgroup is subscribed.
This uses the newsrc mechanism associated with this folder's store.
- isSubscribed in interface Folder
listSubscribed
public Folder[] listSubscribed(String pattern)
throws MessagingException
This folder type does not contain other folders.
- listSubscribed in interface Folder
open
public void open(int mode)
throws MessagingException
This method has no particular meaning in NNTP.
However, we will use it to send a GROUP command and refresh our article
stats.
- open in interface Folder
setSubscribed
public void setSubscribed(boolean flag)
throws MessagingException
Subscribes or unsubscribes to this newsgroup.
This uses the newsrc mechanism associated with this folder's store.
- setSubscribed in interface Folder