Package org.apache.commons.httpclient.methods

Examples of org.apache.commons.httpclient.methods.HeadMethod.releaseConnection()


                assertTrue("Response for HEAD request contained no headers", headers.length > 0);
            } catch (IOException ioe) {
                ioe.printStackTrace();
                fail(ioe.getMessage());
            } finally {
                httpMethod.releaseConnection();
            }
        } catch (URIException e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
View Full Code Here


                assertEquals("TRUE", header.getValue());
            } catch (IOException ioe) {
                ioe.printStackTrace();
                fail(ioe.getMessage());
            } finally {
                httpMethod.releaseConnection();
            }
        } catch (URIException e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
View Full Code Here

    try {
      int code = execute(cluster, method, null, path);
      headers = method.getResponseHeaders();
      return new Response(code, headers, null);
    } finally {
      method.releaseConnection();
    }
  }

  /**
   * Send a GET request
View Full Code Here

        hc.setHost(getHost(), getPort(), getProtocol());
        client.setHostConfiguration(hc);
        client.setState(state);
        HeadMethod method = new HeadMethod("/"+ getWebappContext() +"/auth/basic");
        client.executeMethod(method);
        method.releaseConnection();
        assertEquals(200, method.getStatusCode());
    }
   
}
View Full Code Here

        HeadMethod head = new HeadMethod("http://www.ibiblio.org/");
        client.executeMethod(head);
       
        int status = head.getStatusCode();
        System.out.println("head status code with httpclient: " + status);
        head.releaseConnection();
       
        System.out.println(
            "now check if httpclient dependency on commons-logging has been realized");
        Class clss = Class.forName("org.apache.commons.logging.Log");
        System.out.println("found logging class in classpath: " + clss);
View Full Code Here

    try {
      int code = execute(cluster, method, null, path);
      headers = method.getResponseHeaders();
      return new Response(code, headers, null);
    } finally {
      method.releaseConnection();
    }
  }

  /**
   * Send a GET request
View Full Code Here

        } catch (IOException e) {
            log.error("Unexpected error while testing existence of item.",e);
        } catch (RepositoryException e) {
            log.error(e.getMessage());
        } finally {
            method.releaseConnection();
        }
        return false;
    }

View Full Code Here

            client.executeMethod(headMethod);
            assertNotNull(headMethod.getResponseHeaders());
            Header header = headMethod.getResponseHeader("unresolved-id");
            assertNotNull(header);
            assertEquals("3", header.getValue());
            headMethod.releaseConnection();

            // now the resource that should exist
            headMethod = new HeadMethod(getBaseURI() + "/1");
            client.executeMethod(headMethod);
            assertNotNull(headMethod.getResponseHeaders());
View Full Code Here

            }
            if (getOneMethod != null) {
                getOneMethod.releaseConnection();
            }
            if (headMethod != null) {
                headMethod.releaseConnection();
            }
            if (deleteMethod != null) {
                deleteMethod.releaseConnection();
            }
        }
View Full Code Here

        } catch (IOException e) {
            log.error("Unexpected error while testing existence of item.",e);
        } catch (RepositoryException e) {
            log.error(e.getMessage());
        } finally {
            method.releaseConnection();
        }
        return false;
    }

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.