Package org.apache.commons.net.imap
Class IMAPReply
java.lang.Object
org.apache.commons.net.imap.IMAPReply
Stores IMAP reply code constants.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The reply code indicating command rejection.static final int
The reply code indicating command continuation.static final int
The reply code indicating failure of an operation.static final int
The reply code indicating success of an operation.static final int
The reply code indicating a partial response. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
getReplyCode
(String line) Interpret the String reply code - OK, NO, BAD - in a tagged response as an integer.static int
getUntaggedReplyCode
(String line) Interpret the String reply code - OK, NO, BAD - in an untagged response as an integer.static boolean
isContinuation
(int replyCode) Tests whether the reply line is a continuation, i.e.static boolean
isContinuation
(String line) Tests whether if the reply line is a continuation, i.e.static boolean
isSuccess
(int replyCode) Tests whether whether the reply code indicates success or notstatic boolean
isUntagged
(String line) Tests whether if the reply line is untagged - e.g.static int
literalCount
(String line) Checks if the line introduces a literal, i.e.
-
Field Details
-
OK
The reply code indicating success of an operation.- See Also:
-
NO
The reply code indicating failure of an operation.- See Also:
-
BAD
The reply code indicating command rejection.- See Also:
-
CONT
The reply code indicating command continuation.- See Also:
-
PARTIAL
The reply code indicating a partial response. This is used when a chunk listener is registered and the listener requests that the reply lines are cleared on return.- Since:
- 3.4
- See Also:
-
-
Method Details
-
getReplyCode
Interpret the String reply code - OK, NO, BAD - in a tagged response as an integer.- Parameters:
line
- the tagged line to be checked- Returns:
OK
orNO
orBAD
orCONT
- Throws:
IOException
- if the input has an unexpected format
-
getUntaggedReplyCode
Interpret the String reply code - OK, NO, BAD - in an untagged response as an integer.- Parameters:
line
- the untagged line to be checked- Returns:
OK
orNO
orBAD
orCONT
- Throws:
IOException
- if the input has an unexpected format
-
isContinuation
Tests whether the reply line is a continuation, i.e. starts with "+"- Parameters:
replyCode
- the code to be checked- Returns:
true
if the response was a continuation
-
isContinuation
Tests whether if the reply line is a continuation, i.e. starts with "+"- Parameters:
line
- the line to be checked- Returns:
true
if the line is a continuation
-
isSuccess
Tests whether whether the reply code indicates success or not- Parameters:
replyCode
- the code to check- Returns:
true
if the code equalsOK
-
isUntagged
Tests whether if the reply line is untagged - e.g. "* OK ..."- Parameters:
line
- to be checked- Returns:
true
if the line is untagged
-
literalCount
Checks if the line introduces a literal, i.e. ends with {dd}- Parameters:
line
- the line to check- Returns:
- the literal count, or -1 if there was no literal.
-