Package org.apache.commons.httpclient.methods

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


      throw new NetworkException(ioe.getMessage(), ioe);
    } catch (java.lang.IllegalArgumentException iae) {
      throw new NetworkException(iae.getMessage(), iae);
    } finally {
      if (hMethod != null) {
        hMethod.releaseConnection();
      }
    }
    return head;
  }
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

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

    protected int execute( HttpMethod httpMethod )
        throws IOException
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

        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("/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

        } 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

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.