public class FetchResponse extends IMAPResponse
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.Object> |
extensionItems |
private FetchItem[] |
fitems |
private static char[] |
HEADER |
private Item[] |
items |
private static char[] |
TEXT |
Constructor and Description |
---|
FetchResponse(IMAPResponse r) |
FetchResponse(IMAPResponse r,
FetchItem[] fitems)
Construct a FetchResponse that handles the additional FetchItems.
|
FetchResponse(Protocol p) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getExtensionItems()
Return a map of the extension items found in this fetch response.
|
<T extends Item> |
getItem(java.lang.Class<T> c) |
Item |
getItem(int index) |
static <T extends Item> |
getItem(Response[] r,
int msgno,
java.lang.Class<T> c)
Return the first fetch response item of the given class
for the given message number.
|
int |
getItemCount() |
static <T extends Item> |
getItems(Response[] r,
int msgno,
java.lang.Class<T> c)
Return all fetch response items of the given class
for the given message number.
|
private boolean |
match(char[] itemName)
Does the current buffer match the given item name?
itemName is the name of the IMAP item to compare against.
|
private boolean |
match(java.lang.String itemName)
Does the current buffer match the given item name?
itemName is the name of the IMAP item to compare against.
|
private java.lang.String |
next20()
Return the next 20 characters in the buffer, for exception messages.
|
private void |
parse() |
private boolean |
parseExtensionItem()
If this item is a known extension item, parse it.
|
private Item |
parseItem()
Parse the item at the current position in the buffer,
skipping over the item if successful.
|
getKey, getNumber, keyEquals, readSimpleList
byeResponse, getException, getRest, getTag, getType, isBAD, isBYE, isContinuation, isNextNonSpace, isNO, isOK, isSynthetic, isTagged, isUnTagged, peekByte, readAtom, readAtomString, readAtomStringList, readByte, readByteArray, readBytes, readLong, readNumber, readString, readString, readStringList, reset, skip, skipSpaces, skipToken, supportsUtf8, toString
private Item[] items
private java.util.Map<java.lang.String,java.lang.Object> extensionItems
private final FetchItem[] fitems
private static final char[] HEADER
private static final char[] TEXT
public FetchResponse(Protocol p) throws java.io.IOException, ProtocolException
java.io.IOException
ProtocolException
public FetchResponse(IMAPResponse r) throws java.io.IOException, ProtocolException
java.io.IOException
ProtocolException
public FetchResponse(IMAPResponse r, FetchItem[] fitems) throws java.io.IOException, ProtocolException
r
- the IMAPResponsefitems
- the fetch itemsjava.io.IOException
- for I/O errorsProtocolException
- for protocol failurespublic int getItemCount()
public Item getItem(int index)
public <T extends Item> T getItem(java.lang.Class<T> c)
public static <T extends Item> T getItem(Response[] r, int msgno, java.lang.Class<T> c)
T
- the type of fetch itemr
- the responsesmsgno
- the message numberc
- the classpublic static <T extends Item> java.util.List<T> getItems(Response[] r, int msgno, java.lang.Class<T> c)
T
- the type of fetch itemsr
- the responsesmsgno
- the message numberc
- the classpublic java.util.Map<java.lang.String,java.lang.Object> getExtensionItems()
private void parse() throws ParsingException
ParsingException
private java.lang.String next20()
private Item parseItem() throws ParsingException
ParsingException
private boolean parseExtensionItem() throws ParsingException
ParsingException
private boolean match(char[] itemName)
private boolean match(java.lang.String itemName)