Class FetchResponse


  • public class FetchResponse
    extends IMAPResponse
    This class represents a FETCH response obtained from the input stream of an IMAP server.
    • Field Detail

      • items

        private Item[] items
      • extensionItems

        private java.util.Map<java.lang.String,​java.lang.Object> extensionItems
      • HEADER

        private static final char[] HEADER
      • TEXT

        private static final char[] TEXT
    • 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 responses
        msgno - the message number
        c - 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 responses
        msgno - the message number
        c - 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
      • next20

        private java.lang.String next20()
        Return the next 20 characters in the buffer, for exception messages.
      • parseItem

        private Item parseItem()
                        throws ParsingException
        Parse the item at the current position in the buffer, skipping over the item if successful. Otherwise, return null and leave the buffer position unmodified.
        Throws:
        ParsingException
      • match

        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. NOTE that itemName *must* be all uppercase. If the match is successful, the buffer pointer (index) is incremented past the matched item.
      • match

        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. NOTE that itemName *must* be all uppercase. If the match is successful, the buffer pointer (index) is incremented past the matched item.