FileDocCategorySizeDatePackage
DefaultFolder.javaAPI DocGlassfish v2 API4542Mon May 14 15:28:44 BST 2007com.sun.mail.imap

DefaultFolder

public class DefaultFolder extends IMAPFolder
This class
version
1.2, 97/12/08
author
John Mani

Fields Summary
Constructors Summary
protected DefaultFolder(IMAPStore store)

	super("", UNKNOWN_SEPARATOR , store);
	exists = true; // of course
	type = HOLDS_FOLDERS; // obviously
    
Methods Summary
public voidappendMessages(Message[] msgs)

	// Not applicable on DefaultFolder
	throw new MethodNotSupportedException("Cannot append to Default Folder");
    
public booleandelete(boolean recurse)

  
	// Not applicable on DefaultFolder
	throw new MethodNotSupportedException("Cannot delete Default Folder");
    
public Message[]expunge()

	// Not applicable on DefaultFolder
	throw new MethodNotSupportedException("Cannot expunge Default Folder");
    
public javax.mail.FoldergetFolder(java.lang.String name)

	return new IMAPFolder(name, UNKNOWN_SEPARATOR, (IMAPStore)store);
    
public java.lang.StringgetName()

	return fullName;
    
public javax.mail.FoldergetParent()

	return null;
    
public booleanhasNewMessages()

	// Not applicable on DefaultFolder
	return false;
    
public javax.mail.Folder[]list(java.lang.String pattern)

	ListInfo[] li = null;

	li = (ListInfo[])doCommand(new ProtocolCommand() {
	    public Object doCommand(IMAPProtocol p) throws ProtocolException {
		return p.list("", pattern);
	    }
	});

	if (li == null)
	    return new Folder[0];

	IMAPFolder[] folders = new IMAPFolder[li.length];
	for (int i = 0; i < folders.length; i++)
	    folders[i] = new IMAPFolder(li[i], (IMAPStore)store);
	return folders;
    
public javax.mail.Folder[]listSubscribed(java.lang.String pattern)

	ListInfo[] li = null;

	li = (ListInfo[])doCommand(new ProtocolCommand() {
	    public Object doCommand(IMAPProtocol p) throws ProtocolException {
		return p.lsub("", pattern);
	    }
	});

	if (li == null)
	    return new Folder[0];

	IMAPFolder[] folders = new IMAPFolder[li.length];
	for (int i = 0; i < folders.length; i++)
	    folders[i] = new IMAPFolder(li[i], (IMAPStore)store);
	return folders;
    
public booleanrenameTo(javax.mail.Folder f)

	// Not applicable on DefaultFolder
	throw new MethodNotSupportedException("Cannot rename Default Folder");