|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.mail.Folder org.apache.geronimo.javamail.store.nntp.NNTPFolder
public class NNTPFolder
The base NNTP implementation of the javax.mail.Folder This is a base class for both the Root NNTP server and each NNTP group folder.
Folder
Field Summary | |
---|---|
protected NNTPConnection |
connection
|
protected boolean |
folderOpen
|
protected String |
fullName
|
protected int |
messageCount
|
protected String |
name
|
protected Folder |
parent
|
protected Flags |
permanentFlags
|
protected Session |
session
|
Fields inherited from class javax.mail.Folder |
---|
HOLDS_FOLDERS, HOLDS_MESSAGES, mode, READ_ONLY, READ_WRITE, store |
Constructor Summary | |
---|---|
protected |
NNTPFolder(NNTPStore store)
Super class constructor the base NNTPFolder class. |
Method Summary | |
---|---|
void |
appendMessages(Message[] msgs)
Append messages to a folder. |
protected void |
checkClosed()
Ensure the folder is not open |
protected void |
checkOpen()
Ensure the folder is open |
void |
close(boolean expunge)
Close the folder. |
protected void |
closeFolder()
Peform folder type-specific close actions. |
boolean |
create(int type)
Create a new folder. |
boolean |
delete(boolean recurse)
Delete a folder. |
boolean |
exists()
Indicated whether the folder "exists" or not. |
Message[] |
expunge()
Expunge messages marked for deletion and return a list of the Messages. |
Folder |
getFolder(String name)
Get a named subfolder from this folder. |
String |
getFullName()
Retrieve the folder's full name (including hierarchy information). |
Message |
getMessage(int msgNum)
Checks wether the message is in cache, if not will create a new message object and return it. |
int |
getMessageCount()
Get the count of messages in this folder. |
String |
getName()
Retrieve the folder name. |
Folder |
getParent()
Returns the parent folder for this folder. |
Flags |
getPermanentFlags()
Get the permanentFlags |
char |
getSeparator()
No sub folders, hence there is no notion of a seperator. |
int |
getType()
Return whether this folder can hold just messages or also subfolders. |
boolean |
hasNewMessages()
Check for new messages. |
boolean |
isOpen()
Tests the open status of the folder. |
boolean |
isSeen(int article)
Test if a given article number is marked as SEEN. |
boolean |
isSubscribed()
Retrieve the subscribed status for a folder. |
Folder[] |
list(String pattern)
List the subfolders. |
Folder[] |
listSubscribed(String pattern)
Retrieve the list of subscribed folders that match the given pattern string. |
void |
notifyMessageChangedListeners(int type,
Message m)
|
void |
open(int mode)
|
protected void |
openFolder()
Perform folder type-specific open actions. |
boolean |
renameTo(Folder f)
Rename a folder. |
void |
setSeen(int article,
boolean flag)
Set the SEEN status for an article. |
void |
setSubscribed(boolean flag)
Set the subscribed status for a folder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected NNTPConnection connection
protected Session session
protected String name
protected String fullName
protected Folder parent
protected boolean folderOpen
protected int messageCount
protected Flags permanentFlags
Constructor Detail |
---|
protected NNTPFolder(NNTPStore store)
store
- The javamail store this folder is attached to.Method Detail |
---|
public String getName()
getName
in class Folder
public String getFullName()
getFullName
in class Folder
public Folder getParent() throws MessagingException
getParent
in class Folder
MessagingException
public boolean exists() throws MessagingException
exists
in class Folder
MessagingException
public Folder[] list(String pattern) throws MessagingException
list
in class Folder
pattern
- The folder pattern string.
MessagingException
public Folder[] listSubscribed(String pattern) throws MessagingException
listSubscribed
in class Folder
pattern
- The pattern string used for the matching
MessagingException
public char getSeparator() throws MessagingException
getSeparator
in class Folder
MessagingException
public int getType() throws MessagingException
getType
in class Folder
MessagingException
public boolean create(int type) throws MessagingException
create
in class Folder
type
- The type of folder.
MessagingException
public boolean hasNewMessages() throws MessagingException
hasNewMessages
in class Folder
MessagingException
public Folder getFolder(String name) throws MessagingException
getFolder
in class Folder
name
- The requested name.
MessagingException
public boolean delete(boolean recurse) throws MessagingException
delete
in class Folder
recurse
- The recusion flag.
MessagingException
public boolean renameTo(Folder f) throws MessagingException
renameTo
in class Folder
f
- The new folder specifying the rename location.
MessagingException
public void open(int mode) throws MessagingException
open
in class Folder
MessagingException
Folder.open(int)
protected void openFolder() throws MessagingException
MessagingException
protected void closeFolder() throws MessagingException
MessagingException
public void close(boolean expunge) throws MessagingException
close
in class Folder
expunge
- The expunge flag, which is ignored for NNTP folders.
MessagingException
public boolean isOpen()
isOpen
in class Folder
public Flags getPermanentFlags()
getPermanentFlags
in class Folder
public int getMessageCount() throws MessagingException
getMessageCount
in class Folder
MessagingException
public Message getMessage(int msgNum) throws MessagingException
getMessage
in class Folder
MessagingException
Folder.getMessage(int)
public void appendMessages(Message[] msgs) throws MessagingException
appendMessages
in class Folder
msgs
- The list of messages to append.
MessagingException
public Message[] expunge() throws MessagingException
expunge
in class Folder
MessagingException
protected void checkOpen() throws IllegalStateException
IllegalStateException
protected void checkClosed() throws IllegalStateException
IllegalStateException
public void notifyMessageChangedListeners(int type, Message m)
notifyMessageChangedListeners
in class Folder
this method is protected and cannot be used outside of Folder, therefore
had to explicitly expose it via a method in NNTPFolder, so that
NNTPMessage has access to it
Bad design on the part of the Java Mail API.
public boolean isSubscribed()
isSubscribed
in class Folder
public void setSubscribed(boolean flag) throws MessagingException
setSubscribed
in class Folder
flag
- The new subscribed status.
MessagingException
public boolean isSeen(int article)
article
- The target article number.
public void setSeen(int article, boolean flag) throws MessagingException
article
- The target article.flag
- The new seen setting.
MessagingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |