public class CommandParser extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
CommandParser.ATOM_CHARValidator |
protected static interface |
CommandParser.CharacterValidator
Provides the ability to ensure characters are part of a permitted set.
|
protected static class |
CommandParser.DigitCharValidator |
protected static class |
CommandParser.NoopCharValidator |
| Constructor and Description |
|---|
CommandParser() |
| Modifier and Type | Method and Description |
|---|---|
String |
astring(ImapRequestLineReader request)
Reads an argument of type "astring" from the request.
|
String |
atom(ImapRequestLineReader request)
Reads an argument of type "atom" from the request.
|
protected void |
consumeChar(ImapRequestLineReader request,
char expected)
Consumes the next character in the request, checking that it matches the
expected one.
|
protected String |
consumeLiteral(ImapRequestLineReader request)
Reads an argument of type "literal" from the request, in the format:
"{" charCount "}" CRLF *CHAR8
Note before calling, the request should be positioned so that nextChar
is '{'.
|
protected byte[] |
consumeLiteralAsBytes(ImapRequestLineReader request) |
long |
consumeLong(ImapRequestLineReader request) |
protected String |
consumeQuoted(ImapRequestLineReader request)
Reads a quoted string value from the request.
|
protected String |
consumeWord(ImapRequestLineReader request,
CommandParser.CharacterValidator validator)
Reads the next "word from the request, comprising all characters up to the next SPACE.
|
Date |
dateTime(ImapRequestLineReader request)
Reads a "date-time" argument from the request.
|
void |
endLine(ImapRequestLineReader request)
Consumes the request up to and including the eno-of-line.
|
javax.mail.Flags |
flagList(ImapRequestLineReader request)
Reads a "flags" argument from the request.
|
static boolean |
isCrOrLf(char chr)
Checks if character is either CR or LF.
|
protected boolean |
isListWildcard(char chr) |
String |
mailbox(ImapRequestLineReader request)
Reads a "mailbox" argument from the request.
|
String |
nstring(ImapRequestLineReader request)
Reads an argument of type "nstring" from the request.
|
long |
number(ImapRequestLineReader request)
Reads an argument of type "number" from the request.
|
long |
nzNumber(ImapRequestLineReader request)
Reads an argument of type "nznumber" (a non-zero number)
(NOTE this isn't strictly as per the spec, since the spec disallows
numbers such as "0123" as nzNumbers (although it's ok as a "number".
|
IdRange[] |
parseIdRange(ImapRequestLineReader request)
Reads a "message set" argument, and parses into an IdSet.
|
void |
setFlag(String flagString,
javax.mail.Flags flags) |
String |
tag(ImapRequestLineReader request)
Reads a command "tag" from the request.
|
public String atom(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionpublic String tag(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionpublic String astring(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionpublic String nstring(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionpublic String mailbox(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionpublic Date dateTime(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionprotected String consumeWord(ImapRequestLineReader request, CommandParser.CharacterValidator validator) throws ProtocolException
ProtocolExceptionpublic long consumeLong(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionprotected String consumeLiteral(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionprotected byte[] consumeLiteralAsBytes(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionprotected void consumeChar(ImapRequestLineReader request, char expected) throws ProtocolException
ProtocolExceptionprotected String consumeQuoted(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionpublic javax.mail.Flags flagList(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionpublic void setFlag(String flagString, javax.mail.Flags flags) throws ProtocolException
ProtocolExceptionpublic long number(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionpublic long nzNumber(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionprotected boolean isListWildcard(char chr)
public static boolean isCrOrLf(char chr)
chr - the characterpublic void endLine(ImapRequestLineReader request) throws ProtocolException
request - The requestProtocolException - If characters are encountered before the endLine.public IdRange[] parseIdRange(ImapRequestLineReader request) throws ProtocolException
ProtocolExceptionCopyright © 2006–2017 Icegreen Technologies. All rights reserved.