Package com.belerweb.social.exception

Examples of com.belerweb.social.exception.SocialException


          list.add((T) parse.invoke(null, jsonArray.getJSONObject(i)));
        }
      }
      return list;
    } catch (Exception e) {
      throw new SocialException(e);
    }
  }
View Full Code Here


    } else if (obj instanceof String) {
      try {
        SimpleDateFormat format = new SimpleDateFormat(pattern, locale);
        result = format.parse((String) obj);
      } catch (ParseException e) {
        throw new SocialException(e);
      }
    }

    return result;
  }
View Full Code Here

   * @param accessToken 采用OAuth授权方式为必填参数,其他授权方式不需要此参数,OAuth授权后获得。
   * @param uids 需要获取数据的用户UID,最多不超过100个。
   */
  public Result<UserCounts> counts(String source, String accessToken, List<String> uids) {
    if (uids == null || uids.size() > 100) {
      throw new SocialException("需要获取数据的用户UID,必须且最多不超过100个");
    }

    List<NameValuePair> params = new ArrayList<NameValuePair>();
    weibo.addNotNullParameter(params, "source", source);
    weibo.addNotNullParameter(params, "access_token", accessToken);
View Full Code Here

   * @param oauthSignature 签名值,是由根据上面的几个参数生成的 Base String经HMAC-SHA1算法计算得出。
   */
  public void getOAuth2Token(String oauthConsumerKey, String oauthToken,
      String oauthSignatureMethod, Long oauthTimestamp, String oauthNonce, String oauthVersion,
      String oauthSignature) {
    throw new SocialException("方法还未实现...");
  }
View Full Code Here

      String json =
          weixin.post("https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + accessToken,
              new StringEntity(request.toString(), "UTF-8"));
      return Result.parse(json, Error.class);
    } catch (UnsupportedEncodingException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

        return new Result<com.belerweb.social.weixin.bean.Group>(error);
      }
      return new Result<com.belerweb.social.weixin.bean.Group>(
          com.belerweb.social.weixin.bean.Group.parse(jsonObject.getJSONObject("group")));
    } catch (UnsupportedEncodingException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

          weixin.post(
              "https://api.weixin.qq.com/cgi-bin/groups/update?access_token=" + accessToken,
              new StringEntity(request.toString()));
      return Result.parse(json, Error.class);
    } catch (UnsupportedEncodingException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

      String json =
          weixin.post("https://api.weixin.qq.com/cgi-bin/groups/members/update?access_token="
              + accessToken, new StringEntity(request.toString()));
      return Result.parse(json, Error.class);
    } catch (UnsupportedEncodingException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

        return new Result<com.belerweb.social.weixin.bean.Media>(error);
      }
      media.setId(jsonObject.getString("media_id"));
      return new Result<com.belerweb.social.weixin.bean.Media>(media);
    } catch (ClientProtocolException e) {
      throw new SocialException(e);
    } catch (IOException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

      media.setName(fileName);
      media.setContentType(entity.getContentType().getValue());
      media.setContent(IOUtils.toByteArray(entity.getContent()));
      return new Result<com.belerweb.social.weixin.bean.Media>(media);
    } catch (ClientProtocolException e) {
      throw new SocialException(e);
    } catch (IOException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.belerweb.social.exception.SocialException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.