|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.geronimo.javamail.store.imap.connection.IMAPResponseTokenizer
public class IMAPResponseTokenizer
Nested Class Summary | |
---|---|
static class |
IMAPResponseTokenizer.Token
|
Field Summary | |
---|---|
protected static MailDateFormat |
dateParser
|
protected static byte[] |
decodingTable
|
static IMAPResponseTokenizer.Token |
EOF
|
static IMAPResponseTokenizer.Token |
NIL
|
Constructor Summary | |
---|---|
IMAPResponseTokenizer(byte[] response)
|
Method Summary | |
---|---|
void |
checkLeftParen()
Ensure that the next token in the parsed response is a '(' character. |
boolean |
checkListEnd()
Check to see if we're at the end of a parenthized list without advancing the parsing pointer. |
void |
checkRightParen()
Ensure that the next token in the parsed response is a ')' character. |
void |
checkToken(int type)
Get the next token and verify that it's of the expected type for the context. |
String |
decode(String original)
Decode a Base 64 encoded string value. |
static int |
decode(String original,
int index,
StringBuffer result)
Decode a section of an encoded string value. |
static int |
getEncoding(byte[] value)
Determine what type of token encoding needs to be used for a string value. |
String |
getRemainder()
Get the remainder of the response as a string. |
boolean |
hasMore()
Test if we have more data in the response buffer. |
int |
indexOf(String needle)
Search for a given string starting from the current position cursor. |
int |
indexOf(String needle,
int position)
Search for a string in the response buffer starting from the indicated position. |
protected static void |
initializeDecodingTable()
|
boolean |
match(int position,
String needle)
Test if the bytes in the response buffer match a given string value. |
IMAPResponseTokenizer.Token |
next()
|
IMAPResponseTokenizer.Token |
next(boolean nilAllowed)
|
IMAPResponseTokenizer.Token |
next(boolean nilAllowed,
boolean expandedDelimiters)
|
boolean |
notListEnd()
Tests if we've reached the end of a parenthetical list in our parsing stream. |
IMAPResponseTokenizer.Token |
peek()
|
IMAPResponseTokenizer.Token |
peek(boolean nilAllowed)
|
IMAPResponseTokenizer.Token |
peek(boolean nilAllowed,
boolean expandedDelimiters)
|
InternetAddress |
readAddress()
Read an internet address from a Fetch response. |
InternetAddress[] |
readAddressList()
Parse out a list of addresses. |
String |
readAtom()
Read a string-valued token from the response, verifying this is an ATOM token. |
String |
readAtom(boolean expandedDelimiters)
Read a string-valued token from the response, verifying this is an ATOM token. |
byte[] |
readByteArray()
Read the next token as binary data. |
Date |
readDate()
Read a date from a response string. |
Date |
readDateOrNil()
Read a date from a response string. |
String |
readEncodedString()
Read an encoded string-valued token from the response. |
Flags |
readFlagList()
Read a list of Flag values from an IMAP response, returning a Flags instance containing the appropriate pieces. |
int |
readInteger()
Read a number-valued token from the response. |
protected IMAPResponseTokenizer.Token |
readLiteral()
Parse out a literal string from the response, using the length encoded before the listeral. |
protected byte[] |
readLiteralData()
Parse out a literal string from the response, using the length encoded before the listeral. |
int |
readLong()
Read a number-valued token from the response. |
ParameterList |
readParameterList()
Read a ContentType or ContentDisposition parameter list from an IMAP command response. |
protected String |
readQuotedStringOrNil()
Read a quoted string-valued token from the response. |
String |
readString()
Read a string-valued token from the response. |
List |
readStringList()
Reads a string item which can be encoded either as a single string-valued token or a parenthized list of string tokens. |
String |
readStringOrNil()
Read a string-valued token from the response. |
List |
readStrings()
Reads all remaining tokens and returns them as a list of strings. |
List |
readSystemNameList()
Read a list of Flag values from an IMAP response, returning a Flags instance containing the appropriate pieces. |
void |
skipExtensionItem()
Skip over an extension item. |
void |
skipNestedValue()
Skip over a parenthized value that we're not interested in. |
protected byte[] |
subarray(int start,
int end)
Extract a subarray from the response buffer. |
protected String |
substring(int start,
int end)
Extract a substring from the response buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final byte[] decodingTable
protected static MailDateFormat dateParser
public static final IMAPResponseTokenizer.Token EOF
public static final IMAPResponseTokenizer.Token NIL
Constructor Detail |
---|
public IMAPResponseTokenizer(byte[] response)
Method Detail |
---|
protected static void initializeDecodingTable()
public String getRemainder()
public IMAPResponseTokenizer.Token next() throws MessagingException
MessagingException
public IMAPResponseTokenizer.Token next(boolean nilAllowed) throws MessagingException
MessagingException
public IMAPResponseTokenizer.Token next(boolean nilAllowed, boolean expandedDelimiters) throws MessagingException
MessagingException
public IMAPResponseTokenizer.Token peek() throws MessagingException
MessagingException
public IMAPResponseTokenizer.Token peek(boolean nilAllowed) throws MessagingException
MessagingException
public IMAPResponseTokenizer.Token peek(boolean nilAllowed, boolean expandedDelimiters) throws MessagingException
MessagingException
protected IMAPResponseTokenizer.Token readLiteral() throws MessagingException
ResponseFormatException
MessagingException
protected byte[] readLiteralData() throws MessagingException
ResponseFormatException
MessagingException
protected String substring(int start, int end)
start
- The starting offset.end
- The end offset (+ 1).
protected byte[] subarray(int start, int end)
start
- The starting offset.end
- The end offset (+ 1).
public boolean match(int position, String needle)
position
- The compare position.needle
- The needle string we're testing for.
public int indexOf(String needle)
needle
- The search string.
public int indexOf(String needle, int position)
needle
- The search string.position
- The starting buffer position.
public void checkLeftParen() throws MessagingException
ResponseFormatException
MessagingException
public void checkRightParen() throws MessagingException
ResponseFormatException
MessagingException
public String readString() throws MessagingException
ResponseFormatException
MessagingException
public String readEncodedString() throws MessagingException
ResponseFormatException
MessagingException
public String decode(String original) throws MessagingException
original
- The original encoded string.
MessagingException
public static int decode(String original, int index, StringBuffer result) throws MessagingException
original
- The original source string.index
- The current working index.result
- The StringBuffer used for the decoded result.
MessagingException
public String readAtom() throws MessagingException
ResponseFormatException
MessagingException
public String readAtom(boolean expandedDelimiters) throws MessagingException
ResponseFormatException
MessagingException
public int readInteger() throws MessagingException
ResponseFormatException
MessagingException
public int readLong() throws MessagingException
ResponseFormatException
MessagingException
public String readStringOrNil() throws MessagingException
ResponseFormatException
MessagingException
protected String readQuotedStringOrNil() throws MessagingException
ResponseFormatException
MessagingException
public Date readDate() throws MessagingException
MessagingException
public Date readDateOrNil() throws MessagingException
MessagingException
public InternetAddress readAddress() throws MessagingException
ResponseFormatException
MessagingException
public InternetAddress[] readAddressList() throws MessagingException
ResponseFormatException
MessagingException
public boolean checkListEnd() throws MessagingException
ResponseFormatException
MessagingException
public List readStringList() throws MessagingException
ResponseFormatException
MessagingException
public List readStrings() throws MessagingException
ResponseFormatException
MessagingException
public void skipExtensionItem() throws MessagingException
MessagingException
public void skipNestedValue() throws MessagingException
MessagingException
public void checkToken(int type) throws MessagingException
type
- The type of token we're expecting.
MessagingException
public byte[] readByteArray() throws MessagingException
MessagingException
public static int getEncoding(byte[] value)
value
- The string to test.
public ParameterList readParameterList() throws MessagingException
MessagingException
public boolean hasMore() throws MessagingException
MessagingException
public boolean notListEnd() throws MessagingException
MessagingException
public Flags readFlagList() throws MessagingException
MessagingException
public List readSystemNameList() throws MessagingException
MessagingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |