Package com.azwul.api.exception

Examples of com.azwul.api.exception.AzwulApiException


      if (pool.get(clazz) == null) {
        AzBaseService service;
        try {
          service = clazz.newInstance();
        } catch (Exception e) {
          throw new AzwulApiException("Error instantiating service "
              + clazz, e);
        }
        if (httpConfiguration != null) {
          service.setHttpConfiguration(httpConfiguration);
        } else {
View Full Code Here


    InputStream is = httpResult.getHttpResponse();
    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
    try {
      return reader.readLine();
    } catch (IOException e) {
      throw new AzwulApiException("Error reading basic response", e);
    } finally {
      try {
        is.close();
        httpResult.releaseConnection();
      } catch (Exception ex) {
        throw new AzwulApiException("Error closing basic response", ex);
      }
    }
  }
View Full Code Here

      String line = null;
      while ((line = reader.readLine()) != null) {
        sb.append(line + "\n");
      }
    } catch (Exception ex) {
      throw new AzwulApiException("Error reading basic full", ex);
    } finally {
      try {
        is.close();
        httpResult.releaseConnection();
      } catch (Exception ex) {
        throw new AzwulApiException("Error closing full response", ex);
      }
    }
    return sb.toString();
  }
View Full Code Here

   */
  public InputStream getHttpResponse() {
    try {
      return httpMethod.getResponseBodyAsStream();
    } catch (IOException e) {
      throw new AzwulApiException("Error reading http response stream", e);
    }
  }
View Full Code Here

      if (pool.get(clazz) == null) {
        Object o;
        try {
          o = clazz.newInstance();
        } catch (Exception e) {
          throw new AzwulApiException("Error instantiating service "
              + clazz, e);
        }

        pool.put(clazz, o);
      }
View Full Code Here

    try {
      client.executeMethod(post);
    } catch (Exception e) {
      post.releaseConnection();
      throw new AzwulApiException(e);
    }

    HttpResult httpResult = new HttpResult();
    httpResult.setHttpMethod(post);
    httpResult.setSessionToken(sessionToken);
View Full Code Here

    try {
      client.executeMethod(get);
    } catch (Exception e) {
      get.releaseConnection();
      throw new AzwulApiException(e);
    }

    HttpResult httpResult = new HttpResult();
    httpResult.setHttpMethod(get);
    httpResult.setSessionToken(sessionToken);
View Full Code Here

    }

    try {
      partList.add(new FilePart(fileParamName, file));
    } catch (FileNotFoundException e) {
      throw new AzwulApiException(e);
    }

    for (String paramName : paramsMap.keySet()) {
      partList.add(new StringPart(paramName, paramsMap.get(paramName)));
    }

    filePost.setRequestEntity(new MultipartRequestEntity(partList
        .toArray(new Part[0]), filePost.getParams()));

    try {
      client.executeMethod(filePost);
    } catch (Exception e) {
      filePost.releaseConnection();
      throw new AzwulApiException(e);
    }

    HttpResult httpResult = new HttpResult();
    httpResult.setHttpMethod(filePost);
    httpResult.setSessionToken(sessionToken);
View Full Code Here

    try {
      return ResponseUtil.buildClicInitResult(httpHelper.doPost(
          "/clic/init.html", httpConfiguration, null, params));
    } catch (Exception e) {
      throw new AzwulApiException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.azwul.api.exception.AzwulApiException

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.