Package com.belerweb.social.exception

Examples of com.belerweb.social.exception.SocialException


  public String post(String url, List<NameValuePair> params) {
    try {
      return Http.post(url, params, "UTF-8");
    } catch (HttpException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here


    return post(url, (HttpEntity) null);
  }

  public void addParameter(List<NameValuePair> params, String name, Object value) {
    if (value == null) {
      throw new SocialException("Parameter " + name + " must not be null.");
    }
    params.add(new BasicNameValuePair(name, value.toString()));
  }
View Full Code Here

    try {
      HttpResponse response = Http.CLIENT.execute(request);
      String json = IOUtils.toString(response.getEntity().getContent());
      return Result.parse(json, PicUploadResult.class);
    } catch (ClientProtocolException e) {
      throw new SocialException(e);
    } catch (IOException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

      if (error != null) {
        return new Result<NewT>(error);
      }
      return Result.parse(jsonObject.getJSONObject("data"), NewT.class);
    } catch (ClientProtocolException e) {
      throw new SocialException(e);
    } catch (IOException e) {
      throw new SocialException(e);
    }
  }
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

    try {
      HttpResponse response = Http.CLIENT.execute(request);
      String json = IOUtils.toString(response.getEntity().getContent());
      return Result.parse(json, PicUploadResult.class);
    } catch (ClientProtocolException e) {
      throw new SocialException(e);
    } catch (IOException e) {
      throw new SocialException(e);
    } finally {
      request.releaseConnection();
    }
  }
View Full Code Here

      if (error != null) {
        return new Result<NewT>(error);
      }
      return Result.parse(jsonObject.getJSONObject("data"), NewT.class);
    } catch (ClientProtocolException e) {
      throw new SocialException(e);
    } catch (IOException e) {
      throw new SocialException(e);
    } finally {
      request.releaseConnection();
    }
  }
View Full Code Here

  public String get(String url, List<NameValuePair> params) {
    try {
      return Http.get(url, params);
    } catch (HttpException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

  public String post(String url, List<NameValuePair> params) {
    try {
      return Http.post(url, params);
    } catch (HttpException e) {
      throw new SocialException(e);
    }
  }
View Full Code Here

    return post(url, null);
  }

  public void addParameter(List<NameValuePair> params, String name, Object value) {
    if (value == null) {
      throw new SocialException("Parameter " + name + " must not be null.");
    }
    params.add(new BasicNameValuePair(name, value.toString()));
  }
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.