Package org.apache.commons.httpclient.methods

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


            // save result in cache
            _headCache.put(url, resp);
        }
        finally
        {
            head.releaseConnection();
        }

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

        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

    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 ioe ) {
            throw( new XPathException( this, ioe.getMessage(), ioe ) );
        }
        finally {
            head.releaseConnection();
        }

        return( response );
    }
}
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

    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 (IllegalArgumentException e) {
            // thrown by HttpClient to indicate the URL is not valid, this happens for instance
            // when trying to download a dynamic version (cfr IVY-390)
        } finally {
            if (head != null) {
                head.releaseConnection();
            }
        }
        return UNAVAILABLE;
    }
   
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.