Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpMethodBase.releaseConnection()


            errorResult(e, res);
            return res;
        } finally {
            savedClient = null;
            if (httpMethod != null) {
                httpMethod.releaseConnection();
            }
        }
    }
   
    /**
 
View Full Code Here


            // Follow redirects and download page resources if appropriate:
            res = resultProcessing(areFollowingRedirect, frameDepth, res);

            log.debug("End : sample");
            httpMethod.releaseConnection();
            return res;
        } catch (IllegalArgumentException e)// e.g. some kinds of invalid URL
        {
            res.sampleEnd();
            HTTPSampleResult err = errorResult(e, res);
View Full Code Here

            return err;
        } finally {
            savedClient = null;
            JOrphanUtils.closeQuietly(instream);
            if (httpMethod != null) {
                httpMethod.releaseConnection();
            }
        }
    }

    /**
 
View Full Code Here

                 * connection left open, we go ahead and release the it to free
                 * up resources.
                 */
                if (!leaveHttpConnectionOpen) {
                    try {method.getResponseBodyAsStream().close();} catch (Throwable t) {}
                    method.releaseConnection();
                }
            }
        }
    }

View Full Code Here

            // Respond with the actual guaranteed content length of the uploaded data.
            contentLength = ((PutMethod)httpMethod).getRequestEntity().getContentLength();
        }
               
        // Release connection after PUT (there ought to be no response content)
        httpMethod.releaseConnection();
       
        return new HttpMethodAndByteCount(httpMethod, contentLength);
    }

    /**
 
View Full Code Here

        performRequest(httpMethod, 204);

        // Release connection after DELETE (there's no response content)
        log.debug("Releasing HttpMethod after delete");
        httpMethod.releaseConnection();

        return httpMethod;
    }
       
    /**
 
View Full Code Here

        } catch (IOException e) {
            log.warn("Unable to close response body input stream", e);
        } finally {
            log.debug("Releasing un-wanted bucket HEAD response");
            if (httpMethod != null) {
                httpMethod.releaseConnection();
            }
        }
       
        // If we get this far, the bucket exists.
        return true;
View Full Code Here

            HttpMethodReleaseInputStream releaseIS = new HttpMethodReleaseInputStream(httpMethod);
            responseObject.setDataInputStream(releaseIS);
        } else {               
            // Release connection after HEAD (there's no response content)
            log.debug("Releasing HttpMethod after HEAD");           
            httpMethod.releaseConnection();
        }
       
        return responseObject;
    }
   
View Full Code Here

            HttpMethodReleaseInputStream releaseIS = new HttpMethodReleaseInputStream(httpMethod);
            responseObject.setDataInputStream(releaseIS);
        } else {               
            // Release connection after HEAD (there's no response content)
            log.debug("Releasing HttpMethod after HEAD");           
            httpMethod.releaseConnection();
        }
       
        return responseObject;
    }
   
View Full Code Here

            errorResult(e, res);
            return res;
        } finally {
            savedClient = null;
            if (httpMethod != null) {
                httpMethod.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.