case 'C':
// It starts with C so it should be CONDSTORE
int pos = 0;
while (pos < CONDSTORE.length) {
if (CONDSTORE[pos++] != ImapRequestLineReader.cap(request.consume())) {
throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown option");
}
}
condstore = true;
break;
case 'Q':
// It starts with Q so it should be QRESYNC
request.consumeWord(new CharacterValidator() {
int pos = 0;
public boolean isValid(char chr) {
if (pos >= QRESYNC.length) {
return false;
} else {
return ImapRequestLineReader.cap(chr) == QRESYNC[pos++];
}
}
});
// Consume the SP
request.consumeChar(' ');
// Consume enclosing paren
request.consumeChar('(');
lastKnownUidValidity = request.number();
// Consume the SP
request.consumeChar(' ');
knownModSeq = request.number(true);
char nc = request.nextChar();
if (nc == ' ') {
// All this stuff is now optional
// Consume the SP
request.consumeChar(' ');
uidSet = request.parseIdRange();
// Check for *
checkIdRanges(uidSet, false);
nc = request.nextChar();
if (nc == ' ') {
request.consumeChar(' ');
// This is enclosed in () so remove (
request.consumeChar('(');
knownSequenceSet = request.parseIdRange();
request.consumeChar(' ');
knownUidSet = request.parseIdRange();
// Check for * and check if its in ascending order
checkIdRanges(knownSequenceSet, true);
checkIdRanges(knownUidSet, true);
// This is enclosed in () so remove )
request.consumeChar(')');
}
}
request.consumeChar(')');
break;
default:
throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown option");
}
request.consumeChar(')');
}