Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpGet.releaseConnection()


        }
      }
    }
    finally {
      if (get != null) {
        get.releaseConnection();
      }
    }

    return System.currentTimeMillis() - t;
  }
View Full Code Here


      return true;
    }
    finally {
      if (method != null) {
        method.releaseConnection(); // request facade does this but just making sure
      }
    }
  }

  /**
 
View Full Code Here

      throw new HttpResponseIndicatesErrorException(String.format("Checkin response indicates error! Status line: %s", responseStatusLine.toString()));
    }
   
    this.writeHtmlToFile(Util.filePathCombine("log", "CheckinResponse.html"), this.getResponseAllHeadersAndContentAsString(response));
   
    request.releaseConnection();
    logger.info("Got checkin response.");
  }
 
  private String gotoHomePage() throws URISyntaxException, ClientProtocolException, IOException, HttpResponseIndicatesErrorException
  {
View Full Code Here

    }
   
    String responseAsString = this.getResponseAllHeadersAndContentAsString(response);
    this.writeHtmlToFile(Util.filePathCombine("log", "HomePageResponse.html"), responseAsString);

    request.releaseConnection();
    logger.info("Got home page response.");
    return responseAsString;
  }
 
  private boolean isAlreadyCheckedIn(String homePageResponseAsString)
View Full Code Here

        log.debug("GET url: {}", requestURL);       
        HttpGet request = new HttpGet(requestURL);
        // send the request and print the response
        HttpResponse httpResponse = httpClient.execute(request);
        ApiResponse apiResponse = readResponse(httpResponse);
        request.releaseConnection();
        return apiResponse;
    }

    public ApiResponse delete(String requestURL) throws IOException, SignatureException {
        log.debug("DELETE url: {}", requestURL);
View Full Code Here

                    log.error("error retrieving list of configuration keys: {} {}",new Object[] {response.getStatusLine().getStatusCode(),response.getStatusLine().getReasonPhrase()});
                    throw new MarmottaClientException("error retrieving list of configuration keys: "+response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
            }

        } finally {
            get.releaseConnection();
        }
    }

    /**
     * Return a list of all configurations (keys and values) that are currently set in the Marmotta configuration.
View Full Code Here

                    log.error("error retrieving list of configuration keys: {} {}",new Object[] {response.getStatusLine().getStatusCode(),response.getStatusLine().getReasonPhrase()});
                    throw new MarmottaClientException("error retrieving list of configuration keys: "+response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
            }

        } finally {
            get.releaseConnection();
        }
    }


    /**
 
View Full Code Here

                    log.error("error retrieving configuration {}: {} {}",new Object[] {key,response.getStatusLine().getStatusCode(),response.getStatusLine().getReasonPhrase()});
                    throw new MarmottaClientException("error retrieving configuration "+key+": "+response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase());
            }

        } finally {
            get.releaseConnection();
        }
    }

    /**
     * Update the configuration "key" with the given value. Value can be either a list of values or one of the
View Full Code Here

                        List<String> additionalRequestUrls = client.getClient().execute(get, handler);
                        requestUrls.addAll(additionalRequestUrls);

                        visited.add(requestUrl);
                    } finally {
                        get.releaseConnection();
                    }
                }

                requestUrl = requestUrls.poll();
            }
View Full Code Here

                    handler.requestUrl = requestUri;
                    handler.language   = lang;
                    client.getClient().execute(get, handler);
                } finally {
                    get.releaseConnection();
                }
            }

            Date expiresDate = handler.expiresDate;
            if (expiresDate == null) {
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.