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

FLAGS

public class FLAGS extends Flags implements Item
This class
author
John Mani

Fields Summary
static final char[]
name
public int
msgno
private static final long
serialVersionUID
Constructors Summary
public FLAGS(IMAPResponse r)
Constructor


          
         
	msgno = r.getNumber();

	r.skipSpaces();
	String[] flags = r.readSimpleList();
	if (flags != null) { // if not empty flaglist
	    for (int i = 0; i < flags.length; i++) {
		String s = flags[i];
		if (s.length() >= 2 && s.charAt(0) == '\\") {
		    switch (Character.toUpperCase(s.charAt(1))) {
		    case 'S": // \Seen
			add(Flags.Flag.SEEN);
			break;
		    case 'R": // \Recent
			add(Flags.Flag.RECENT);
			break;
		    case 'D":
			if (s.length() >= 3) {
			    char c = s.charAt(2);
			    if (c == 'e" || c == 'E") // \Deleted
				add(Flags.Flag.DELETED);
			    else if (c == 'r" || c == 'R") // \Draft
				add(Flags.Flag.DRAFT);
			} else
			    add(s);	// unknown, treat it as a user flag
			break;
		    case 'A": // \Answered
			add(Flags.Flag.ANSWERED);
			break;
		    case 'F": // \Flagged
			add(Flags.Flag.FLAGGED);
			break;
		    case '*": // \*
			add(Flags.Flag.USER);
			break;
		    default:
			add(s);		// unknown, treat it as a user flag
			break;
		    }
		} else
		    add(s);
	    }
	}
    
Methods Summary