Exec.Result result = null;
try {
result = Exec.execute(cmd);
if (false == this.isSuccess(result.getExitCode())) {
aborted.set(true);
notifyException(new DataRetrieveException(result.toString()));
notifyStatusChange(DownloadStatus.EXCEPTION);
} else {
this.analyzeResult(result);
this.notifyMessage(result.toString());
if (aborted.get()) {
// 中断
notifyStatusChange(DownloadStatus.ABORT);
} else if (paused.get()) {
// 暂停
notifyStatusChange(DownloadStatus.PAUSED);
} else {
// 下载完成
notifyStatusChange(DownloadStatus.COMPLETE);
}
}
} catch (Exception ex) {
aborted.set(true);
notifyException(new DataRetrieveException((result != null) ? ex.getMessage() + SystemUtils.LINE_SEPARATOR
+ result.toString() : ex.getMessage(), ex));
}
}