Package org.apache.http.client.methods

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


      }
      return responseContent;
    } finally {
      if (response != null)
        response.close();
      method.releaseConnection();
    }
  }

  @Override
  public void setIndexStructureBuilder(IJIRAIssueIndexStructureBuilder indexStructureBuilder) {
View Full Code Here


        try {
            HttpResponse response =  client.execute(get);
            int status = response.getStatusLine().getStatusCode();
            assertEquals(HttpStatus.SC_OK, status);
        } finally {
            get.releaseConnection();
        }
    }

    @Test
    @Ignore
View Full Code Here

        try {
            HttpResponse response =  client.execute(get);
            int status = response.getStatusLine().getStatusCode();
            assertEquals(HttpStatus.SC_OK, status);
        } finally {
            get.releaseConnection();
        }
    }

}
View Full Code Here

            return IOUtils.toByteArray(entity.getContent());
        } finally {
            if (response.getEntity() != null) {
                EntityUtils.consume(response.getEntity());
            }
            httpGet.releaseConnection();
        }
    }

    public ReplicationStatus collectStatusFromZooKeepeer() throws Exception {
        Map<String, Map<String, Status>> statusByPeerAndServer = Maps.newHashMap();
View Full Code Here

                           httpResponse.getStatusLine().getStatusCode(),
                            "Unexpected failure: " + httpResponse.getStatusLine().getReasonPhrase()
                    );
                }

                httpGet.releaseConnection();

            } else {
                returnExceptionMessage(response, HttpStatus.SC_FORBIDDEN, "only HTTP(S) protocol supported");
            }
        }
View Full Code Here

            //throw new ServletException("Some unexpected error occurred. Error text was: " + e.getMessage());
            returnExceptionMessage(response, HttpStatus.SC_INTERNAL_SERVER_ERROR,
                    "Some unexpected error occurred. Error text was: " + e.getMessage());
        } finally {
            if (httpGet != null) {
                httpGet.releaseConnection();
            }
        }
    }

    private String createURI(HttpServletRequest request, String url) {
View Full Code Here

      log.info (" Unable to connect to '" + req.toString() + "'");
      log.info (ioe.getMessage());
      return null;
    } finally {
        // Release current connection to the connection pool once you are done
        req.releaseConnection ();
    }
   
    return filename;
  }
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

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.