Top Description Fields Constructors Methods
com.sun.mail.imap.protocol

public Class IMAPResponse

extends Response
Class Inheritance
Known Direct Subclasses
com.sun.mail.imap.protocol.FetchResponse
Imports
java.io.*, java.util.*, com.sun.mail.util.ASCIIUtility, com.sun.mail.iap.*

This class represents a response obtained from the input stream of an IMAP server.
Author
John Mani

Field Summary

Modifier and TypeField and Description
private String
private int
Inherited from com.sun.mail.iap.Response:
BADbufferBYECONTINUATIONexindexNOOKpindexsizeSYNTHETICtagTAG_MASKTAGGEDtypeTYPE_MASKUNTAGGEDutf8

Constructor Summary

AccessConstructor and Description
public
public
IMAPResponse(IMAPResponse
the IMAPResponse to copy
r
)

Copy constructor.

public
IMAPResponse(String
the response string
r
)

For testing.

public
IMAPResponse(String
the response string
r
,
boolean
UTF-8 allowed?
utf8
)

For testing.

Method Summary

Modifier and TypeMethod and Description
public String
public int
private void
init()

public boolean
public String[]

Returns:

the list items as a String array
readSimpleList
()

Read a list of space-separated "flag-extension" sequences and return the list as a array of Strings.

Inherited from com.sun.mail.iap.Response:
byeResponsegetExceptiongetRestgetTaggetTypeisBADisBYEisContinuationisNextNonSpaceisNOisOKisSyntheticisTaggedisUnTaggedpeekBytereadAtomreadAtomStringreadAtomStringListreadBytereadByteArrayreadBytesreadLongreadNumberreadStringreadStringreadStringListresetskipskipSpacesskipTokensupportsUtf8toString

Field Detail

keyback to summary
private String key
numberback to summary
private int number

Constructor Detail

IMAPResponseback to summary
public IMAPResponse(Protocol c) throws IOException, ProtocolException
IMAPResponseback to summary
public IMAPResponse(IMAPResponse r)

Copy constructor.

Parameters
r:IMAPResponse

the IMAPResponse to copy

IMAPResponseback to summary
public IMAPResponse(String r) throws IOException, ProtocolException

For testing.

Parameters
r:String

the response string

Exceptions
IOException:
for I/O errors
ProtocolException:
for protocol failures
IMAPResponseback to summary
public IMAPResponse(String r, boolean utf8) throws IOException, ProtocolException

For testing.

Parameters
r:String

the response string

utf8:boolean

UTF-8 allowed?

Exceptions
IOException:
for I/O errors
ProtocolException:
for protocol failures
Since
JavaMail 1.6.0

Method Detail

getKeyback to summary
public String getKey()
getNumberback to summary
public int getNumber()
initback to summary
private void init() throws IOException, ProtocolException
keyEqualsback to summary
public boolean keyEquals(String k)
readSimpleListback to summary
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:String[]

the list items as a String array