Package com.cartodb

Examples of com.cartodb.CartoDBException


    try {
      sqlQuery = URLEncoder.encode(sqlQuery,ENCODING);
      json = IOUtils.toString(new URL(apiURL+sqlQuery), ENCODING);
    } catch (MalformedURLException e) {
      System.out.println("Could not get URL " + apiURL+sqlQuery);
      throw new CartoDBException(e.getMessage());
    } catch (UnsupportedEncodingException e) {
      throw new CartoDBException(e.getMessage());
    } catch (IOException e) {
      System.out.println("Could not execute " + sqlQuery+ " on CartoDB : ");
      throw new CartoDBException(e.getMessage());
    }
    return json;
  }
View Full Code Here


     */
    public ApiKeyCartoDBClient(String user, String apiKey) throws CartoDBException {
        this.user = user;
        this.apiKey = apiKey;
        if(this.apiKey == null || this.apiKey.length() == 0) {
            throw new CartoDBException("provided API key is not valid");
        }
        init();
    }
View Full Code Here

              json = IOUtils.toString(new URL(apiURL + "?" + params), ENCODING);
            }
          
           
        } catch (MalformedURLException e) {
            throw new CartoDBException("Could not get URL " + apiURL + sqlQuery);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }catch (IOException e) {
          e.printStackTrace();
            throw new CartoDBException("Could not execute " + sqlQuery + " on CartoDB : ");
        }
        return json;
    }
View Full Code Here

    oAuthService.signRequest(accessToken, request);
   
    Response response = request.send();
   
    if(!response.isSuccessful()){
      throw new CartoDBException("The query " + sqlQuery + " failed. Response code : " + response.getCode());
    }
    json = response.getBody();
    return json;
  }
View Full Code Here

TOP

Related Classes of com.cartodb.CartoDBException

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.