Package com.sun.mail.imap.protocol

# Class IMAPResponse

java.lang.Object
com.sun.mail.iap.Response
com.sun.mail.imap.protocol.IMAPResponse

Direct Known Subclasses:
  `FetchResponse`

public class IMAPResponse extends Response
This class represents a response obtained from the input stream of an IMAP server.

Author:
  John Mani

## Field Summary

### Fields inherited from class com.sun.mail.iap.Response

`BAD, buffer, BYE, CONTINUATION, ex, index, NO, OK, pindex, size, SYNTHETIC, tag, TAG_MASK, TAGGED, type, TYPE_MASK, UNTAGGED, utf8`

## Constructor Summary

Constructors
Constructor
Description
`IMAPResponse(Protocol c)`
`IMAPResponse(IMAPResponse r)`
Copy constructor.
`IMAPResponse(String r)`
For testing.
`IMAPResponse(String r, boolean utf8)`
For testing.

## Method Summary

Modifier and Type
Method
Description
`String`
`getKey()`
`int`
`getNumber()`
`boolean`
`keyEquals(String k)`
`String[]`
`readSimpleList()`
Read a list of space-separated "flag-extension" sequences and return the list as a array of Strings.

### 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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### IMAPResponse

public IMAPResponse(Protocol c) throws IOException, ProtocolException

Throws:
  `IOException`
  `ProtocolException`

### IMAPResponse

public IMAPResponse(IMAPResponse r)
Copy constructor.

Parameters:
  `r` - the IMAPResponse to copy

### IMAPResponse

public IMAPResponse(String r) throws IOException, ProtocolException
For testing.

Parameters:
  `r` - the response string
Throws:
  `IOException` - for I/O errors
  `ProtocolException` - for protocol failures

### IMAPResponse

public IMAPResponse(String r, boolean utf8) throws IOException, ProtocolException
For testing.

Parameters:
  `r` - the response string
  `utf8` - UTF-8 allowed?
Throws:
  `IOException` - for I/O errors
  `ProtocolException` - for protocol failures
Since:
  JavaMail 1.6.0

## Method Details

### readSimpleList

public String[] readSimpleList()
Read a list of space-separated "flag-extension" sequences and return the list as a array of Strings. An empty list is returned as null. Each item is expected to be an atom, possibly preceeded by a backslash, but we aren't that strict; we just look for strings separated by spaces and terminated by a right paren. We assume items are always ASCII.

Returns:
  the list items as a String array

### getKey

public String getKey()

### keyEquals

public boolean keyEquals(String k)

### getNumber

public int getNumber()