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.
-
-
Constructor Summary
Constructors Constructor Description IMAPResponse(Protocol c)
IMAPResponse(IMAPResponse r)
Copy constructor.IMAPResponse(java.lang.String r)
For testing.IMAPResponse(java.lang.String r, boolean utf8)
For testing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getKey()
int
getNumber()
boolean
keyEquals(java.lang.String k)
java.lang.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
-
-
-
-
Constructor Detail
-
IMAPResponse
public IMAPResponse(Protocol c) throws java.io.IOException, ProtocolException
- Throws:
java.io.IOException
ProtocolException
-
IMAPResponse
public IMAPResponse(IMAPResponse r)
Copy constructor.- Parameters:
r
- the IMAPResponse to copy
-
IMAPResponse
public IMAPResponse(java.lang.String r) throws java.io.IOException, ProtocolException
For testing.- Parameters:
r
- the response string- Throws:
java.io.IOException
- for I/O errorsProtocolException
- for protocol failures
-
IMAPResponse
public IMAPResponse(java.lang.String r, boolean utf8) throws java.io.IOException, ProtocolException
For testing.- Parameters:
r
- the response stringutf8
- UTF-8 allowed?- Throws:
java.io.IOException
- for I/O errorsProtocolException
- for protocol failures- Since:
- JavaMail 1.6.0
-
-
Method Detail
-
readSimpleList
public java.lang.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 java.lang.String getKey()
-
keyEquals
public boolean keyEquals(java.lang.String k)
-
getNumber
public int getNumber()
-
-