Package org.apache.commons.net.imap
Class IMAPReply
- java.lang.Object
-
- org.apache.commons.net.imap.IMAPReply
-
public final class IMAPReply extends java.lang.ObjectIMAPReply stores IMAP reply code constants.
-
-
Field Summary
Fields Modifier and Type Field Description static intBADThe reply code indicating command rejection.static intCONTThe reply code indicating command continuation.static intNOThe reply code indicating failure of an operation.static intOKThe reply code indicating success of an operation.static intPARTIALThe reply code indicating a partial response.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetReplyCode(java.lang.String line)Intepret the String reply code - OK, NO, BAD - in a tagged response as a integer.static intgetUntaggedReplyCode(java.lang.String line)Intepret the String reply code - OK, NO, BAD - in an untagged response as a integer.static booleanisContinuation(int replyCode)Checks if the reply line is a continuation, i.e.static booleanisContinuation(java.lang.String line)Checks if the reply line is a continuation, i.e.static booleanisSuccess(int replyCode)Checks whether the reply code indicates success or notstatic booleanisUntagged(java.lang.String line)Checks if the reply line is untagged - e.g.static intliteralCount(java.lang.String line)Checks if the line introduces a literal, i.e.
-
-
-
Field Detail
-
OK
public static final int OK
The reply code indicating success of an operation.- See Also:
- Constant Field Values
-
NO
public static final int NO
The reply code indicating failure of an operation.- See Also:
- Constant Field Values
-
BAD
public static final int BAD
The reply code indicating command rejection.- See Also:
- Constant Field Values
-
CONT
public static final int CONT
The reply code indicating command continuation.- See Also:
- Constant Field Values
-
PARTIAL
public static final int 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:
- Constant Field Values
-
-
Method Detail
-
isUntagged
public static boolean isUntagged(java.lang.String line)
Checks if the reply line is untagged - e.g. "* OK ..."- Parameters:
line- to be checked- Returns:
trueif the line is untagged
-
isContinuation
public static boolean isContinuation(java.lang.String line)
Checks if the reply line is a continuation, i.e. starts with "+"- Parameters:
line- the line to be checked- Returns:
trueif the line is untagged
-
getReplyCode
public static int getReplyCode(java.lang.String line) throws java.io.IOExceptionIntepret the String reply code - OK, NO, BAD - in a tagged response as a integer.
-
literalCount
public static int literalCount(java.lang.String line)
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.
-
getUntaggedReplyCode
public static int getUntaggedReplyCode(java.lang.String line) throws java.io.IOExceptionIntepret the String reply code - OK, NO, BAD - in an untagged response as a integer.
-
isSuccess
public static boolean isSuccess(int replyCode)
Checks whether the reply code indicates success or not- Parameters:
replyCode- the code to check- Returns:
trueif the code equalsOK
-
isContinuation
public static boolean isContinuation(int replyCode)
Checks if the reply line is a continuation, i.e. starts with "+"- Parameters:
replyCode- the code to be checked- Returns:
trueif the response was a continuation
-
-