Package com.cloudcontrolled.api.client.exception

Examples of com.cloudcontrolled.api.client.exception.SerializationException


  protected <T> Response<T> deserializeError(InputStream inputStream, Request<T> request) {
    String content = null;
    try {
      content = IOUtils.readStringFromStream(inputStream);
    } catch (IOException e) {
      throw new SerializationException(e);
    }

    return deserializeError(content, request);
  }
View Full Code Here


  protected <T> Response<T> deserialize(InputStream inputStream, Request<T> request) {
    String content = null;
    try {
      content = IOUtils.readStringFromStream(inputStream);
    } catch (IOException e) {
      throw new SerializationException(e);
    }

    return deserialize(content, request);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public <T> Response<T> fromJSON(String response, Response<T> target) {
    try {
      response = StandardizationUtil.getJSONStandardizer(target).normalize(response);
    } catch (Exception e) {
      throw new SerializationException(e);
    }

    try {
      Response<T> fromJson = gson.fromJson(response, target.getClass());
      if (fromJson == null) {
        fromJson = target;
      }
      return fromJson;
    } catch (JsonSyntaxException jse) {
      throw new SerializationException(jse);
    }
  }
View Full Code Here

TOP

Related Classes of com.cloudcontrolled.api.client.exception.SerializationException

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.