blob: dd618703e25a7882ecc960bf0cd6050e520ad49d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package com.libmailcore;
/** POP Operation. */
public class POPOperation extends Operation {
/**
Returns error once the operation finished running. It will return null if the operation
successfully ran.
*/
public MailException exception() {
if (errorCode() == ErrorCode.ErrorNone) {
return null;
}
return new MailException(errorCode());
}
private native int errorCode();
/**
Calls the method succeeded() of the callback if the operation succeeded or failed()
if the operation failed.
@see com.libmailcore.OperationCallback
*/
protected void callCallback()
{
if (callback != null) {
if (errorCode() == ErrorCode.ErrorNone) {
callback.succeeded();
}
else {
callback.failed(exception());
}
}
}
}
|