- java.lang.Object
-
- com.sun.mail.iap.Response
-
- com.sun.mail.imap.protocol.IMAPResponse
-
- com.sun.mail.imap.protocol.FetchResponse
-
public class FetchResponse extends IMAPResponse
This class represents a FETCH response obtained from the input stream of an IMAP server.- Author:
- John Mani, Bill Shannon
-
-
Constructor Summary
Constructors Constructor Description FetchResponse(Protocol p)
FetchResponse(IMAPResponse r)
FetchResponse(IMAPResponse r, FetchItem[] fitems)
Construct a FetchResponse that handles the additional FetchItems.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
getExtensionItems()
Return a map of the extension items found in this fetch response.Item
getItem(int index)
static <T extends Item>
TgetItem(Response[] r, int msgno, java.lang.Class<T> c)
Return the first fetch response item of the given class for the given message number.<T extends Item>
TgetItem(java.lang.Class<T> c)
int
getItemCount()
static <T extends Item>
java.util.List<T>getItems(Response[] r, int msgno, java.lang.Class<T> c)
Return all fetch response items of the given class for the given message number.-
Methods inherited from class com.sun.mail.imap.protocol.IMAPResponse
getKey, getNumber, keyEquals, readSimpleList
-
Methods inherited from class com.sun.mail.iap.Response
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
-
-
-
-
Constructor Detail
-
FetchResponse
public FetchResponse(Protocol p) throws java.io.IOException, ProtocolException
- Throws:
java.io.IOException
ProtocolException
-
FetchResponse
public FetchResponse(IMAPResponse r) throws java.io.IOException, ProtocolException
- Throws:
java.io.IOException
ProtocolException
-
FetchResponse
public FetchResponse(IMAPResponse r, FetchItem[] fitems) throws java.io.IOException, ProtocolException
Construct a FetchResponse that handles the additional FetchItems.- Parameters:
r
- the IMAPResponsefitems
- the fetch items- Throws:
java.io.IOException
- for I/O errorsProtocolException
- for protocol failures- Since:
- JavaMail 1.4.6
-
-
Method Detail
-
getItemCount
public int getItemCount()
-
getItem
public Item getItem(int index)
-
getItem
public <T extends Item> T getItem(java.lang.Class<T> c)
-
getItem
public static <T extends Item> T 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.- Type Parameters:
T
- the type of fetch item- Parameters:
r
- the responsesmsgno
- the message numberc
- the class- Returns:
- the fetch item
-
getItems
public static <T extends Item> java.util.List<T> getItems(Response[] r, int msgno, java.lang.Class<T> c)
Return all fetch response items of the given class for the given message number.- Type Parameters:
T
- the type of fetch items- Parameters:
r
- the responsesmsgno
- the message numberc
- the class- Returns:
- the list of fetch items
- Since:
- JavaMail 1.5.2
-
getExtensionItems
public java.util.Map<java.lang.String,java.lang.Object> getExtensionItems()
Return a map of the extension items found in this fetch response. The map is indexed by extension item name. Callers should not modify the map.- Returns:
- Map of extension items, or null if none
- Since:
- JavaMail 1.4.6
-
-