public class

DefaultFolder

extends IMAPFolder
java.lang.Object
   ↳ com.google.code.javax.mail.Folder
     ↳ com.google.code.com.sun.mail.imap.IMAPFolder
       ↳ com.google.code.com.sun.mail.imap.DefaultFolder

Class Overview

The default IMAP folder (root of the naming hierarchy).

Summary

[Expand]
Inherited Constants
From class com.google.code.com.sun.mail.imap.IMAPFolder
From class com.google.code.javax.mail.Folder
From interface com.google.code.javax.mail.UIDFolder
[Expand]
Inherited Fields
From class com.google.code.com.sun.mail.imap.IMAPFolder
From class com.google.code.javax.mail.Folder
Protected Constructors
DefaultFolder(IMAPStore store)
Public Methods
void appendMessages(Message[] msgs)
Append the given messages into this folder.
boolean delete(boolean recurse)
Delete this folder.
Message[] expunge()
Expunge all messages marked as DELETED.
Folder getFolder(String name)
Get the named subfolder.
synchronized String getName()
Get the name of this folder.
Folder getParent()
Get this folder's parent.
boolean hasNewMessages()
Check whether this folder has new messages.
synchronized Folder[] list(String pattern)
List all subfolders matching the specified pattern.
synchronized Folder[] listSubscribed(String pattern)
List all subscribed subfolders matching the specified pattern.
boolean renameTo(Folder f)
Rename this folder.
[Expand]
Inherited Methods
From class com.google.code.com.sun.mail.imap.IMAPFolder
From class com.google.code.javax.mail.Folder
From class java.lang.Object
From interface com.google.code.com.sun.mail.iap.ResponseHandler
From interface com.google.code.javax.mail.UIDFolder

Protected Constructors

protected DefaultFolder (IMAPStore store)

Parameters
store

Public Methods

public void appendMessages (Message[] msgs)

Append the given messages into this folder.

Parameters
msgs Array of Messages to be appended

public boolean delete (boolean recurse)

Delete this folder.

Parameters
recurse
Returns
  • true if the GmailFolder is deleted successfully

public Message[] expunge ()

Expunge all messages marked as DELETED.

Returns
  • array of expunged Message objects

public Folder getFolder (String name)

Get the named subfolder.

Parameters
name Name of the GmailFolder
Returns
  • GmailFolder object

public synchronized String getName ()

Get the name of this folder.

Returns
  • name of the GmailFolder

public Folder getParent ()

Get this folder's parent.

Returns
  • Parent folder

public boolean hasNewMessages ()

Check whether this folder has new messages.

Returns
  • true if the Store has new Messages

public synchronized Folder[] list (String pattern)

List all subfolders matching the specified pattern.

Parameters
pattern The match pattern
Returns
  • array of matching GmailFolder objects. An empty array is returned if no matching Folders exist.

public synchronized Folder[] listSubscribed (String pattern)

List all subscribed subfolders matching the specified pattern.

Parameters
pattern The match pattern
Returns
  • array of matching subscribed GmailFolder objects. An empty array is returned if no matching subscribed folders exist.

public boolean renameTo (Folder f)

Rename this folder.

Parameters
f A folder representing the new name for this GmailFolder
Returns
  • true if the GmailFolder is renamed successfully