This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


com.sun.mail.iap
class Response

com.sun.mail.iap.Response
Direct Known Subclasses:
IMAPResponse

public class Response
extends Object

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


Field Summary
static int BAD
          
protected byte[] buffer
          
static int BYE
          
static int CONTINUATION
          
protected int index
          
static int NO
          
static int OK
          
protected int pindex
          
protected int size
          
static int SYNTHETIC
          
protected String tag
          
static int TAGGED
          
static int TAG_MASK
          
protected int type
          
static int TYPE_MASK
          
static int UNTAGGED
          
 
Constructor Summary

          Read a new Response from the given Protocol

          Copy constructor.

          
 
Method Summary
static Response

          Return a Response object that looks like a BYE protocol response.
 String

          Return the rest of the response as a string, usually used to return the arbitrary message text after a NO response.
 String

          Return the tag, if this is a tagged statement.
 int

          
 boolean

          
 boolean

          
 boolean

          
 boolean

          
 boolean

          
 boolean

          
 boolean

          
 boolean

          
 byte

          
 String

          Extract an ATOM, starting at the current position.
 String
readAtom(char delim)

          Extract an ATOM, but stop at the additional delimiter (if not NUL).
 String

          Extract an ASTRING, starting at the current position and return as a String.
 byte

          Return the next byte from this Statement.
 ByteArray

          Extract a NSTRING, starting at the current position.
 ByteArrayInputStream

          Extract a NSTRING, starting at the current position.
 long

          Extract a long number, starting at the current position.
 int

          Extract an integer, starting at the current position.
 String

          Extract a NSTRING, starting at the current position.
 String
readString(char delim)

          Read a string as an arbitrary sequence of characters, stopping at the delimiter Used to read part of a response code inside [].
 String[]

          
 void

          Reset pointer to beginning of response.
 void
skip(int count)

          
 void

          
 void

          Skip to the next space, for use in error recovery while parsing.
 String

          
 

Field Detail

BAD

public static final int BAD

buffer

protected byte[] buffer

BYE

public static final int BYE

CONTINUATION

public static final int CONTINUATION

index

protected int index

NO

public static final int NO

OK

public static final int OK

pindex

protected int pindex

size

protected int size

SYNTHETIC

public static final int SYNTHETIC

tag

protected String tag

TAGGED

public static final int TAGGED

TAG_MASK

public static final int TAG_MASK

type

protected int type

TYPE_MASK

public static final int TYPE_MASK

UNTAGGED

public static final int UNTAGGED
Constructor Detail

Response

public Response(Protocol p)
         throws IOException,
                ProtocolException
Read a new Response from the given Protocol

Parameters:
p - the Protocol object
Throws:
IOException
ProtocolException

Response

public Response(Response r)
Copy constructor.

Parameters:
r

Response

public Response(String s)
Parameters:
s
Method Detail

byeResponse

public static Response byeResponse(Exception ex)
Return a Response object that looks like a BYE protocol response. Include the details of the exception in the response string.

Parameters:
ex

getRest

public String getRest()
Return the rest of the response as a string, usually used to return the arbitrary message text after a NO response.


getTag

public String getTag()
Return the tag, if this is a tagged statement.

Returns:
tag of this tagged statement

getType

public int getType()

isBAD

public boolean isBAD()

isBYE

public boolean isBYE()

isContinuation

public boolean isContinuation()

isNO

public boolean isNO()

isOK

public boolean isOK()

isSynthetic

public boolean isSynthetic()

isTagged

public boolean isTagged()

isUnTagged

public boolean isUnTagged()

peekByte

public byte peekByte()

readAtom

public String readAtom()
Extract an ATOM, starting at the current position. Updates the internal index to beyond the Atom.

Returns:
an Atom

readAtom

public String readAtom(char delim)
Extract an ATOM, but stop at the additional delimiter (if not NUL). Used to parse a response code inside [].

Parameters:
delim

readAtomString

public String readAtomString()
Extract an ASTRING, starting at the current position and return as a String. An ASTRING can be a QuotedString, a Literal or an Atom Any errors in parsing returns null ASTRING := QuotedString | Literal | Atom

Returns:
a String

readByte

public byte readByte()
Return the next byte from this Statement.

Returns:
the next byte.

readByteArray

public ByteArray readByteArray()
Extract a NSTRING, starting at the current position. Return it as a ByteArray. The sequence 'NIL' is returned as null NSTRING := QuotedString | Literal | "NIL"

Returns:
a ByteArray

readBytes

public ByteArrayInputStream readBytes()
Extract a NSTRING, starting at the current position. Return it as a ByteArrayInputStream. The sequence 'NIL' is returned as null NSTRING := QuotedString | Literal | "NIL"

Returns:
a ByteArrayInputStream

readLong

public long readLong()
Extract a long number, starting at the current position. Updates the internal index to beyond the number. Returns -1 if a long number was not found.

Returns:
a long

readNumber

public int readNumber()
Extract an integer, starting at the current position. Updates the internal index to beyond the number. Returns -1 if a number was not found.

Returns:
a number

readString

public String readString()
Extract a NSTRING, starting at the current position. Return it as a String. The sequence 'NIL' is returned as null NSTRING := QuotedString | Literal | "NIL"

Returns:
a String

readString

public String readString(char delim)
Read a string as an arbitrary sequence of characters, stopping at the delimiter Used to read part of a response code inside [].

Parameters:
delim

readStringList

public String[] readStringList()

reset

public void reset()
Reset pointer to beginning of response.


skip

public void skip(int count)
Parameters:
count

skipSpaces

public void skipSpaces()

skipToken

public void skipToken()
Skip to the next space, for use in error recovery while parsing.


toString

public String toString()
Overrides:
toString in class Object


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention. The official Sun™ documentation can be found here at http://java.sun.com/products/javamail/javadocs/index.html.