diff options
author | 2015-01-07 00:24:58 -0800 | |
---|---|---|
committer | 2015-01-07 00:24:58 -0800 | |
commit | b3713c0d84c3c00fbd5583cc2fe6913bfdcecd44 (patch) | |
tree | 516c562e9e9cd317f7afb9ed342bbda171239777 /src/java/com/libmailcore/SMTPOperation.java | |
parent | 090301ae3d2ff1dae80f340367461a3551f21c3a (diff) |
Java wrapper for POP, NNTP and SMTP
Diffstat (limited to 'src/java/com/libmailcore/SMTPOperation.java')
-rw-r--r-- | src/java/com/libmailcore/SMTPOperation.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/java/com/libmailcore/SMTPOperation.java b/src/java/com/libmailcore/SMTPOperation.java new file mode 100644 index 00000000..16567b5f --- /dev/null +++ b/src/java/com/libmailcore/SMTPOperation.java @@ -0,0 +1,24 @@ +package com.libmailcore; + +public class SMTPOperation extends Operation { + public MailException exception() { + if (errorCode() == ErrorCode.ErrorNone) { + return null; + } + return new MailException(errorCode()); + } + + private native int errorCode(); + + protected void callCallback() + { + if (callback != null) { + if (errorCode() == ErrorCode.ErrorNone) { + callback.succeeded(); + } + else { + callback.failed(exception()); + } + } + } +} |