com.sun.mail.iap
类 Response

java.lang.Object
  继承者 com.sun.mail.iap.Response
直接已知子类:
IMAPResponse

public class Response
extends Object

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

版本:
1.1, 97/11/10
作者:
John Mani

字段摘要
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 TAG_MASK
           
static int TAGGED
           
protected  int type
           
static int TYPE_MASK
           
static int UNTAGGED
           
 
构造方法摘要
Response(Protocol p)
          Read a new Response from the given Protocol
Response(Response r)
          Copy constructor.
Response(String s)
           
 
方法摘要
static Response byeResponse(Exception ex)
          Return a Response object that looks like a BYE protocol response.
 String getRest()
          Return the rest of the response as a string, usually used to return the arbitrary message text after a NO response.
 String getTag()
          Return the tag, if this is a tagged statement.
 int getType()
           
 boolean isBAD()
           
 boolean isBYE()
           
 boolean isContinuation()
           
 boolean isNO()
           
 boolean isOK()
           
 boolean isSynthetic()
           
 boolean isTagged()
           
 boolean isUnTagged()
           
 byte peekByte()
           
 String readAtom()
          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 readAtomString()
          Extract an ASTRING, starting at the current position and return as a String.
 byte readByte()
          Return the next byte from this Statement.
 ByteArray readByteArray()
          Extract a NSTRING, starting at the current position.
 ByteArrayInputStream readBytes()
          Extract a NSTRING, starting at the current position.
 long readLong()
          Extract a long number, starting at the current position.
 int readNumber()
          Extract an integer, starting at the current position.
 String readString()
          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[] readStringList()
           
 void reset()
          Reset pointer to beginning of response.
 void skip(int count)
           
 void skipSpaces()
           
 void skipToken()
          Skip to the next space, for use in error recovery while parsing.
 String toString()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

index

protected int index

pindex

protected int pindex

size

protected int size

buffer

protected byte[] buffer

type

protected int type

tag

protected String tag

TAG_MASK

public static final int TAG_MASK
另请参见:
常量字段值

CONTINUATION

public static final int CONTINUATION
另请参见:
常量字段值

TAGGED

public static final int TAGGED
另请参见:
常量字段值

UNTAGGED

public static final int UNTAGGED
另请参见:
常量字段值

TYPE_MASK

public static final int TYPE_MASK
另请参见:
常量字段值

OK

public static final int OK
另请参见:
常量字段值

NO

public static final int NO
另请参见:
常量字段值

BAD

public static final int BAD
另请参见:
常量字段值

BYE

public static final int BYE
另请参见:
常量字段值

SYNTHETIC

public static final int SYNTHETIC
另请参见:
常量字段值
构造方法详细信息

Response

public Response(String s)

Response

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

参数:
p - the Protocol object
抛出:
IOException
ProtocolException

Response

public Response(Response r)
Copy constructor.

方法详细信息

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.


skipSpaces

public void skipSpaces()

skipToken

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


skip

public void skip(int count)

peekByte

public byte peekByte()

readByte

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

返回:
the next byte.

readAtom

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

返回:
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 [].


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 [].


readStringList

public String[] readStringList()

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.

返回:
a number

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.

返回:
a long

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"

返回:
a String

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"

返回:
a ByteArrayInputStream

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"

返回:
a ByteArray

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

返回:
a String

getType

public int getType()

isContinuation

public boolean isContinuation()

isTagged

public boolean isTagged()

isUnTagged

public boolean isUnTagged()

isOK

public boolean isOK()

isNO

public boolean isNO()

isBAD

public boolean isBAD()

isBYE

public boolean isBYE()

isSynthetic

public boolean isSynthetic()

getTag

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

返回:
tag of this tagged statement

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.


reset

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


toString

public String toString()
覆盖:
Object 中的 toString


Copyright © 2013. All Rights Reserved.