Package org.apache.commons.httpclient.methods

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


    } catch (final Exception e) {
      LOGGER.log(Level.WARNING, "Unable to connect [ " + strUrl
          + " ] marking site home page as ACL document", e);
      siteDataDocument.setDocumentType(DocumentType.ACL);
    } finally {
      method.releaseConnection();
    }

    return siteDataDocument;
  }
}
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

        hc.setHost(host, port, "http");
        client.setHostConfiguration(hc);
        client.setState(state);
        HeadMethod method = new HeadMethod("/"+ webAppContext +"/auth/basic");
        client.executeMethod(method);
        method.releaseConnection();
        assertEquals(200, method.getStatusCode());
    }

}
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

                        reporter.error( "Cannot reach " + description + " with URL: \'" + url + "\'.\nError: "
                            + e.getMessage() );
                    }
                    finally
                    {
                        headMethod.releaseConnection();
                    }
                }
            }
            else
            {
View Full Code Here

                        "Failed to transfer file: " + url + ". Return code is: " + statusCode );
            }
        }
        finally
        {
            headMethod.releaseConnection();
        }
    }

    protected int execute( HttpMethod httpMethod )
        throws IOException
View Full Code Here

        HeadMethod head = new HeadMethod("/test/");
        try {
            this.client.executeMethod(head);
        } finally {
            head.releaseConnection();
        }
        assertNotNull(head.getStatusLine());
        assertEquals(HttpStatus.SC_OK, head.getStatusLine().getStatusCode());
        Header auth = head.getRequestHeader("Authorization");
        assertNotNull(auth);
View Full Code Here

                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

            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

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.