Package org.apache.commons.httpclient.methods

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


        } 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


        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

                return headers;
            } else {
                throw ExceptionConverter.generate(new DavException(statusCode, ("Unable to load headers at " + uri + " - Status line = " + method.getStatusLine().toString())));
            }
        } finally {
            method.releaseConnection();
        }
    }

    int loadType(String uri) throws RepositoryException, IOException {
        DavPropertyNameSet nameSet = new DavPropertyNameSet();
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

            return true;
        } catch (IOException e) {
            throw new ResourceException("Unable to contact resource URL: " + resourceUrl, e);
        } finally {
            headMethod.releaseConnection();
        }
    }

    /** {@inheritDoc} */
    public InputStream getInputStream() throws ResourceException {
View Full Code Here

        } catch (IOException e) {
            throw new ResourceException("Unable to contact resource URL: " + resourceUrl, e);
        } catch (DateParseException e) {
            throw new ResourceException("Unable to parse last modified date for resource:" + resourceUrl, e);
        } finally {
            headMethod.releaseConnection();
        }
    }

    /** {@inheritDoc} */
    public String getLocation() {
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

            throw new YadisException("I/O transport error: ",
                    YadisResult.HEAD_TRANSPORT_ERROR, e);
        }
        finally
        {
            head.releaseConnection();
        }
    }
}
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.