|
||||||||||
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.pop3.POP3Folder
public class POP3Folder
The POP3 implementation of the javax.mail.Folder Note that only INBOX is supported in POP3
Folder
Field Summary | |
---|---|
protected boolean |
exists
|
protected int |
folderType
|
protected String |
fullName
|
protected boolean |
isFolderOpen
|
protected int |
mode
|
protected int |
msgCount
|
Fields inherited from class javax.mail.Folder |
---|
HOLDS_FOLDERS, HOLDS_MESSAGES, READ_ONLY, READ_WRITE, store |
Constructor Summary | |
---|---|
POP3Folder(POP3Store store,
String name)
Create a new folder associate with a POP3 store instance. |
Method Summary | |
---|---|
void |
appendMessages(Message[] msgs)
|
protected void |
cleanupFolder(boolean disconnected)
Do folder cleanup. |
void |
close(boolean expunge)
Close a POP3 folder. |
boolean |
create(int type)
Always returns false as any creation operation must fail. |
boolean |
delete(boolean recurse)
|
boolean |
exists()
Indicate whether a folder exists. |
Message[] |
expunge()
|
protected void |
expungeDeletedMessages(POP3Connection connection)
Mark any messages we've flagged as deleted from the POP3 server before closing. |
void |
fetch(Message[] msgs,
FetchProfile fp)
|
protected POP3Connection |
getConnection()
Retrieve the connection attached to this folder. |
Folder |
getFolder(String name)
|
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 folder message count. |
int |
getMode()
|
String |
getName()
Retrieve the folder name. |
Folder |
getParent()
Never return "this" as the parent folder. |
Flags |
getPermanentFlags()
|
char |
getSeparator()
No sub folders, hence there is no notion of a seperator. |
int |
getType()
There's no hierarchy in POP3, so the only type is HOLDS_MESSAGES (and only one of those exists). |
String |
getUID(Message msg)
Retrieve the UID for a given message. |
boolean |
hasNewMessages()
No way to detect new messages, so always return false. |
boolean |
isOpen()
|
Folder[] |
list(String pattern)
|
void |
notifyMessageChangedListeners(int type,
Message m)
|
void |
open(int mode)
|
protected void |
releaseConnection(POP3Connection connection)
Release our connection back to the Store. |
boolean |
renameTo(Folder f)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean isFolderOpen
protected int mode
protected int msgCount
protected String fullName
protected boolean exists
protected int folderType
Constructor Detail |
---|
public POP3Folder(POP3Store store, String name)
store
- The owning Store.name
- The name of the folder. Note that POP3 stores only
have 2 real folders, the root ("") and the in-basket
("INBOX"). It is possible to create other instances
of Folder associated with the Store, but they will
be non-functional.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
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 to create. This is ignored.
MessagingException
public boolean hasNewMessages() throws MessagingException
hasNewMessages
in class Folder
MessagingException
public Folder getFolder(String name) throws MessagingException
getFolder
in class Folder
MessagingException
public boolean delete(boolean recurse) throws MessagingException
delete
in class Folder
MessagingException
public boolean renameTo(Folder f) throws MessagingException
renameTo
in class Folder
MessagingException
public void open(int mode) throws MessagingException
open
in class Folder
MessagingException
Folder.open(int)
public void close(boolean expunge) throws MessagingException
close
in class Folder
expunge
- The expunge flag (ignored for POP3).
MessagingException
protected void expungeDeletedMessages(POP3Connection connection) throws MessagingException
MessagingException
protected void cleanupFolder(boolean disconnected) throws MessagingException
expunge
- Indicates whether open messages should be expunged.disconnected
- The disconnected flag. If true, the server has cut
us off, which means our connection can not be returned
to the connection pool.
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
MessagingException
public Message[] expunge() throws MessagingException
expunge
in class Folder
MessagingException
public int getMode() throws IllegalStateException
getMode
in class Folder
IllegalStateException
public void fetch(Message[] msgs, FetchProfile fp) throws MessagingException
fetch
in class Folder
MessagingException
The JavaMail API recommends that this method be overrident to provide a
meaningfull implementation.
public String getUID(Message msg) throws MessagingException
msg
- The message of interest.
MessagingException
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 POP3Folder, so that
POP3Message has access to it
Bad design on the part of the Java Mail API.
protected POP3Connection getConnection() throws MessagingException
MessagingException
protected void releaseConnection(POP3Connection connection) throws MessagingException
connection
- The connection to release.
MessagingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |