| java.lang.Object | ||
| ↳ | com.google.code.javax.mail.Folder | |
| ↳ | com.google.code.com.sun.mail.pop3.DefaultFolder | |
The POP3 DefaultFolder. Only contains the "INBOX" folder.
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.code.javax.mail.Folder
| |||||||||||
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.code.javax.mail.Folder
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Append given Messages to this folder.
| |||||||||||
Close this GmailFolder.
| |||||||||||
Create this folder on the Store.
| |||||||||||
Delete this GmailFolder.
| |||||||||||
Tests if this folder physically exists on the Store.
| |||||||||||
Expunge (permanently remove) messages marked DELETED.
| |||||||||||
Return the GmailFolder object corresponding to the given name.
| |||||||||||
Returns the full name of this GmailFolder.
| |||||||||||
Get the Message object corresponding to the given message
number.
| |||||||||||
Get total number of messages in this GmailFolder.
| |||||||||||
Returns the name of this GmailFolder.
| |||||||||||
Returns the parent folder of this folder.
| |||||||||||
Get the permanent flags supported by this GmailFolder.
| |||||||||||
Return the delimiter character that separates this GmailFolder's pathname
from the names of immediate subfolders.
| |||||||||||
Returns the type of this GmailFolder, that is, whether this folder can hold
messages or subfolders or both.
| |||||||||||
Returns true if this GmailFolder has new messages since the last time
this indication was reset.
| |||||||||||
Indicates whether this GmailFolder is in the 'open' state.
| |||||||||||
Returns a list of Folders belonging to this GmailFolder's namespace
that match the specified pattern.
| |||||||||||
Open this GmailFolder.
| |||||||||||
Rename this GmailFolder.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.code.javax.mail.Folder
| |||||||||||
From class
java.lang.Object
| |||||||||||
Append given Messages to this folder. This method can be invoked on a closed GmailFolder. An appropriate MessageCountEvent is delivered to any MessageCountListener registered on this folder when the messages arrive in the folder.
GmailFolder implementations must not abort this operation if a Message in the given message array turns out to be an expunged Message.
| msgs | Array of Messages to be appended |
|---|
| MessagingException |
|---|
Close this GmailFolder. This method is valid only on open Folders.
A CLOSED ConnectionEvent is delivered to any ConnectionListeners registered on this GmailFolder. Note that the folder is closed even if this method terminates abnormally by throwing a MessagingException.
| expunge | Expunges all deleted messages if this flag is true |
|---|
| MessagingException |
|---|
Create this folder on the Store. When this folder is created, any folders in its path that do not exist are also created.
If the creation is successful, a CREATED FolderEvent is delivered to any FolderListeners registered on this GmailFolder and this Store.
| type | The type of this folder. |
|---|
| MessagingException |
|---|
Delete this GmailFolder. This method will succeed only on a closed GmailFolder.
The recurse flag controls whether the deletion affects
subfolders or not. If true, all subfolders are deleted, then this
folder itself is deleted. If false, the behaviour is dependent on
the folder type and is elaborated below:
If the folder contains subfolders there are 3 possible choices an implementation is free to do:
| recurse |
|---|
| MessagingException |
|---|
Tests if this folder physically exists on the Store. This method can be invoked on a closed GmailFolder.
Expunge (permanently remove) messages marked DELETED. Returns an
array containing the expunged message objects. The
getMessageNumber method
on each of these message objects returns that Message's original
(that is, prior to the expunge) sequence number. A MessageCountEvent
containing the expunged messages is delivered to any
MessageCountListeners registered on the folder.
Expunge causes the renumbering of Message objects subsequent to the expunged messages. Clients that use message numbers as references to messages should be aware of this and should be prepared to deal with the situation (probably by flushing out existing message number caches and reloading them). Because of this complexity, it is better for clients to use Message objects as references to messages, rather than message numbers. Any expunged Messages objects still have to be pruned, but other Messages in that folder are not affected by the expunge.
After a message is expunged, only the isExpunged and
getMessageNumber methods are still valid on the
corresponding Message object; other methods may throw
MessageRemovedException
| MessagingException |
|---|
Return the GmailFolder object corresponding to the given name. Note that
this folder does not physically have to exist in the Store. The
exists() method on a GmailFolder indicates whether it really
exists on the Store.
In some Stores, name can be an absolute path if it starts with the hierarchy delimiter. Otherwise, it is interpreted relative to this GmailFolder.
GmailFolder objects are not cached by the Store, so invoking this method on the same name multiple times will return that many distinct GmailFolder objects.
This method can be invoked on a closed GmailFolder.
| name | Name of the GmailFolder |
|---|
| MessagingException |
|---|
Returns the full name of this GmailFolder. If the folder resides under the root hierarchy of this Store, the returned name is relative to the root. Otherwise an absolute name, starting with the hierarchy delimiter, is returned.
This method can be invoked on a closed GmailFolder.
Get the Message object corresponding to the given message number. A Message object's message number is the relative position of this Message in its GmailFolder. Messages are numbered starting at 1 through the total number of message in the folder. Note that the message number for a particular Message can change during a session if other messages in the GmailFolder are deleted and the GmailFolder is expunged.
Message objects are light-weight references to the actual message that get filled up on demand. Hence GmailFolder implementations are expected to provide light-weight Message objects.
Unlike GmailFolder objects, repeated calls to getMessage with the same message number will return the same Message object, as long as no messages in this folder have been expunged.
Since message numbers can change within a session if the folder is expunged , clients are advised not to use message numbers as references to messages. Use Message objects instead.
| msgno | The message number |
|---|
| MessagingException |
|---|
Get total number of messages in this GmailFolder.
This method can be invoked on a closed folder. However, note that for some folder implementations, getting the total message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to support this functionality in the closed state, in which case this method must return -1.
Clients invoking this method on a closed folder must be aware that this is a potentially expensive operation. Clients must also be prepared to handle a return value of -1 in this case.
| MessagingException |
|---|
Returns the name of this GmailFolder.
This method can be invoked on a closed GmailFolder.
Returns the parent folder of this folder. This method can be invoked on a closed GmailFolder. If this folder is the top of a folder hierarchy, this method returns null.
Note that since GmailFolder objects are not cached, invoking this method returns a new distinct GmailFolder object.
Get the permanent flags supported by this GmailFolder. Returns a Flags object that contains all the flags supported.
The special flag Flags.Flag.USER indicates that this GmailFolder
supports arbitrary user-defined flags.
The supported permanent flags for a folder may not be available until the folder is opened.
Return the delimiter character that separates this GmailFolder's pathname from the names of immediate subfolders. This method can be invoked on a closed GmailFolder.
Returns the type of this GmailFolder, that is, whether this folder can hold messages or subfolders or both. The returned value is an integer bitfield with the appropriate bits set. This method can be invoked on a closed folder.
Returns true if this GmailFolder has new messages since the last time
this indication was reset. When this indication is set or reset
depends on the GmailFolder implementation (and in the case of IMAP,
depends on the server). This method can be used to implement
a lightweight "check for new mail" operation on a GmailFolder without
opening it. (For example, a thread that monitors a mailbox and
flags when it has new mail.) This method should indicate whether
any messages in the GmailFolder have the RECENT flag set.
Note that this is not an incremental check for new mail, i.e., it cannot be used to determine whether any new messages have arrived since the last time this method was invoked. To implement incremental checks, the GmailFolder needs to be opened.
This method can be invoked on a closed GmailFolder that can contain Messages.
| MessagingException |
|---|
Indicates whether this GmailFolder is in the 'open' state.
Returns a list of Folders belonging to this GmailFolder's namespace
that match the specified pattern. Patterns may contain the wildcard
characters "%", which matches any character except hierarchy
delimiters, and "*", which matches any character.
As an example, given the folder hierarchy:
Personal/
Finance/
Stocks
Bonus
StockOptions
Jokes
list("*") on "Personal" will return the whole
hierarchy. list("%") on "Personal" will return "Finance" and
"Jokes". list("Jokes") on "Personal" will return "Jokes".list("Stock*") on "Finance" will return "Stocks"
and "StockOptions". GmailFolder objects are not cached by the Store, so invoking this method on the same pattern multiple times will return that many distinct GmailFolder objects.
This method can be invoked on a closed GmailFolder.
| pattern | The match pattern |
|---|
| MessagingException |
|---|
Open this GmailFolder. This method is valid only on Folders that can contain Messages and that are closed.
If this folder is opened successfully, an OPENED ConnectionEvent is delivered to any ConnectionListeners registered on this GmailFolder.
The effect of opening multiple connections to the same folder on a specifc Store is implementation dependent. Some implementations allow multiple readers, but only one writer. Others allow multiple writers as well as readers.
| mode | Open the GmailFolder READ_ONLY or READ_WRITE |
|---|
| MessagingException |
|---|
Rename this GmailFolder. This method will succeed only on a closed GmailFolder.
If the rename is successful, a RENAMED FolderEvent is delivered to FolderListeners registered on this folder and its containing Store.
| f | A folder representing the new name for this GmailFolder |
|---|
| MessagingException |
|---|