FileDocCategorySizeDatePackage
Status.javaAPI DocJavaMail 1.4.33732Tue Nov 17 10:38:10 GMT 2009com.sun.mail.imap.protocol

Status

public class Status extends Object
STATUS response.
author
John Mani

Fields Summary
public String
mbox
public int
total
public int
recent
public long
uidnext
public long
uidvalidity
public int
unseen
static final String[]
standardItems
Constructors Summary
public Status(Response r)


         
	mbox = r.readAtomString(); // mailbox := astring

	// Workaround buggy IMAP servers that don't quote folder names
	// with spaces.
	final StringBuffer buffer = new StringBuffer();
	boolean onlySpaces = true;

	while (r.peekByte() != '(" && r.peekByte() != 0) {
	    final char next = (char)r.readByte();

	    buffer.append(next);

	    if (next != ' ") {
		onlySpaces = false;
	    }
	}

	if (!onlySpaces) {
	    mbox = (mbox + buffer).trim();
	}

	if (r.readByte() != '(")
	    throw new ParsingException("parse error in STATUS");
	
	do {
	    String attr = r.readAtom();
	    if (attr.equalsIgnoreCase("MESSAGES"))
		total = r.readNumber();
	    else if (attr.equalsIgnoreCase("RECENT"))
		recent = r.readNumber();
	    else if (attr.equalsIgnoreCase("UIDNEXT"))
		uidnext = r.readLong();
	    else if (attr.equalsIgnoreCase("UIDVALIDITY"))
		uidvalidity = r.readLong();
	    else if (attr.equalsIgnoreCase("UNSEEN"))
		unseen = r.readNumber();
	} while (r.readByte() != ')");
    
Methods Summary
public static voidadd(com.sun.mail.imap.protocol.Status s1, com.sun.mail.imap.protocol.Status s2)

	if (s2.total != -1)
	    s1.total = s2.total;
	if (s2.recent != -1)
	    s1.recent = s2.recent;
	if (s2.uidnext != -1)
	    s1.uidnext = s2.uidnext;
	if (s2.uidvalidity != -1)
	    s1.uidvalidity = s2.uidvalidity;
	if (s2.unseen != -1)
	    s1.unseen = s2.unseen;