Search in sources :

Example 1 with BaseSinaBean

use of org.aisen.weibo.sina.sinasdk.bean.BaseSinaBean in project AisenWeiBo by wangdan.

the class HttpsUtility method parseResponse.

@Override
protected <T> T parseResponse(String resultStr, Class<T> responseCls) throws TaskException {
    T result = super.parseResponse(resultStr, responseCls);
    if (result instanceof OfflineService.OfflineLength) {
        OfflineService.OfflineLength iLength = (OfflineService.OfflineLength) result;
        iLength.setLength(resultStr.length());
    }
    if (result instanceof BaseSinaBean) {
        BaseSinaBean sinaBean = (BaseSinaBean) result;
        if (sinaBean.getError_code() > 0 && !TextUtils.isEmpty(sinaBean.getError())) {
            throw new TaskException(String.valueOf(sinaBean.getError_code()), sinaBean.getError());
        }
    }
    return result;
}
Also used : OfflineService(org.aisen.weibo.sina.service.OfflineService) TaskException(org.aisen.android.network.task.TaskException) BaseSinaBean(org.aisen.weibo.sina.sinasdk.bean.BaseSinaBean)

Aggregations

TaskException (org.aisen.android.network.task.TaskException)1 OfflineService (org.aisen.weibo.sina.service.OfflineService)1 BaseSinaBean (org.aisen.weibo.sina.sinasdk.bean.BaseSinaBean)1