Examples of StringHandler


Examples of com.esri.gpt.framework.http.StringHandler

   // httpClient.setTimeoutMillisecs(service.getTimeoutMillisecs());
    httpClient.setMethodName(MethodName.POST);
//   httpClient.setAxlRequest(getAxlRequest());
    StringProvider cprov = new StringProvider(requestBody,"text/xml");
    httpClient.setContentProvider(cprov);
    StringHandler sh = new StringHandler();
    httpClient.setContentHandler(sh);
 
    httpClient.execute();
   
//   setAxlResponse(httpClient.getAxlResponse());
View Full Code Here

Examples of com.esri.gpt.framework.http.StringHandler

  LOGGER.log(Level.FINER, "Reading metadata of source URI: \"{0}\" through proxy: {1}", new Object[]{sourceUri, this});
  sourceUri = Val.chkStr(sourceUri).replaceAll("\\{", "%7B").replaceAll("\\}", "%7D");
  HttpClientRequest cr = new HttpClientRequest();
  cr.setBatchHttpClient(this.info.getBatchHttpClient());
  cr.setUrl(sourceUri);
  StringHandler sh = new StringHandler();
  cr.setContentHandler(sh);
  cr.setCredentialProvider(info.newCredentialProvider());
  cr.execute();
  String mdText = sh.getContent();
  LOGGER.log(Level.FINER, "Received metadata of source URI: \"{0}\" through proxy: {1}", new Object[]{sourceUri, this});
  LOGGER.finest(mdText);
  return mdText;
}
View Full Code Here

Examples of com.esri.gpt.framework.http.StringHandler

    url = Val.chkStr(url).replaceAll("\\{", "%7B").replaceAll("\\}", "%7D");
    HttpClientRequest cr = new HttpClientRequest();
    cr.setUrl(url);

    StringHandler sh = new StringHandler();
    cr.setContentHandler(sh);

    cr.execute();

    String mdText = sh.getContent();
    LOGGER.finer("Received metadata of id: \"" +sourceUri+ "\" through proxy: "+this);
    LOGGER.finest(mdText);
    return mdText;

  } catch (XPathExpressionException ex) {
View Full Code Here

Examples of com.esri.gpt.framework.http.StringHandler

    LOGGER.log(Level.FINER, "Reading metadata of source URI: \"{0}\" through proxy: {1}", new Object[]{sourceUri, this});
    sourceUri = Val.chkStr(sourceUri).replaceAll("\\{", "%7B").replaceAll("\\}", "%7D");
    HttpClientRequest cr = new HttpClientRequest();
    cr.setBatchHttpClient(this.info.getBatchHttpClient());
    cr.setUrl(sourceUri);
    StringHandler sh = new StringHandler();
    cr.setContentHandler(sh);
    cr.execute();
    String mdText = sh.getContent();
    LOGGER.log(Level.FINER, "Received metadata of source URI: \"{0}\" through proxy: {1}", new Object[]{sourceUri, this});
    LOGGER.finest(mdText);
    return mdText;
  }
View Full Code Here

Examples of com.esri.gpt.framework.http.StringHandler

  try {
    LOGGER.log(Level.FINER, "Loading folder content of {0}", url);
   
    HttpClientRequest cr = new HttpClientRequest();
    cr.setUrl(url);
    StringHandler sh = new StringHandler();
    cr.setContentHandler(sh);
    cr.setCredentialProvider(info.newCredentialProvider());
    cr.setBatchHttpClient(info.getBatchHttpClient());
    cr.execute();
   
    iterator = parseResonse(sh.getContent()).iterator();

    LOGGER.log(Level.FINER, "Loading folder content of {0} completed.", url);
  } catch (Exception ex) {
    noMore = true;
    iterator = null;
View Full Code Here

Examples of com.esri.gpt.framework.http.StringHandler

        StringBuilder params = new StringBuilder();
        con.appendToken(params);
        AgpProperties hdr = con.makeRequestHeaderProperties();
        AgpClient client = con.ensureClient();
        StringProvider prov = new StringProvider(params.toString(),sCType);
        StringHandler handler = new StringHandler();;
        client.executeRequest(sUrl,hdr,prov,handler);
        String sWebMapJson = handler.getContent();
       
       
        /*
        web map
        "operationalLayers":[
View Full Code Here

Examples of com.esri.gpt.framework.http.StringHandler

      this.array = array;
    }

    public void run() {
      try {
        StringHandler sh = new StringHandler();
        HttpClientRequest request = new HttpClientRequest();

        request.setUrl(httpReqDef.getUrl());
        request.setContentProvider(httpReqDef.getContentProvider());
        request.setCredentialProvider(cp);
        request.setContentHandler(sh);

        request.execute();

        if (request.getResponseInfo().getResponseCode() == HttpURLConnection.HTTP_OK) {
          String strContent = Val.chkStr(sh.getContent());
          Document docContent = null;
          String contentType = Val.chkStr(request.getResponseInfo().getContentType());

          try {
            if (strContent.length() > 0 && (contentType.toLowerCase().contains("xml") || strContent.startsWith("<?xml"))) {
View Full Code Here

Examples of com.esri.gpt.framework.http.StringHandler

  @Override
  public boolean checkConnection(IMessageCollector mb) {
    try {
      HttpClientRequest httpRequest = new HttpClientRequest();
      httpRequest.setUrl(protocol.getSourceHost());
      httpRequest.setContentHandler(new StringHandler());
      httpRequest.execute();
      return true;
    } catch (IOException ex) {
      mb.addErrorMessage("catalog.harvest.manage.test.err.HarvestConnectionException");
    }
View Full Code Here

Examples of com.esri.gpt.framework.http.StringHandler

  public boolean checkConnection(IMessageCollector mb) {
    try {
      HttpClientRequest httpRequest = new HttpClientRequest();
      httpRequest.setUrl(url);
      httpRequest.setCredentialProvider(getCredentialProvider());
      httpRequest.setContentHandler(new StringHandler());
      httpRequest.execute();
      return true;
    } catch (IOException ex) {
      mb.addErrorMessage("catalog.harvest.manage.test.err.HarvestConnectionException");
    }
View Full Code Here

Examples of com.esri.gpt.framework.http.StringHandler

    params.append("&inSR=").append(inSR);
    params.append("&outSR=").append(outSR);
   
    HttpClientRequest request = new HttpClientRequest();
    request.setUrl(geometryServiceURL+"/project?"+params);
    StringHandler handler = new StringHandler();
    request.setContentHandler(handler);
    request.execute();

    JSONObject response = new JSONObject(handler.getContent());
    if (response.has("error")) {
      JSONObject error = response.getJSONObject("error");
      int code = error.getInt("code");
      String message = error.getString("message");
      throw new HttpClientException(code, message);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.