Package org.apache.commons.httpclient

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


                    contents[j] = get.getResponseBodyAsString();
                }

                assertEquals(contents[0], contents[1]);
            } finally {
                get.releaseConnection();
            }
            sessionResult[i] = contents[0];
        }

        assertNotSame(sessionResult[0], sessionResult[1]);
View Full Code Here


                    contents[j] = get.getResponseBodyAsString();
                }

                assertEquals(contents[0], contents[1]);
            } finally {
                get.releaseConnection();
            }
            sessionResult[i] = contents[0];
        }

        assertNotSame(sessionResult[0], sessionResult[1]);
View Full Code Here

            {
                try
                {
                    final HttpMethod head = createHeadMethod( m_uri );
                    executeMethod( head );
                    head.releaseConnection();
                    return;
                }
                catch ( final IOException e )
                {
                    if ( getLogger().isDebugEnabled() )
View Full Code Here

            }
            finally
            {
                if ( uploader != null )
                {
                    uploader.releaseConnection();
                }
            }
        }

        /**
 
View Full Code Here

            // Return XML
            InputSource input = new InputSource(is);
            parser = (SAXParser) this.manager.lookup(SAXParser.ROLE);
            parser.parse(input, this.xmlConsumer);
            httpMethod.releaseConnection();
        } catch (SAXException e) {
            throw e;
        } catch (Exception e) {
            getLogger().error("Generation failed: ", e);
            throw new SAXException(e);
View Full Code Here

                throw exception;
            }

        } finally {
            method.releaseConnection();
        }
    }

    public HttpClient getHttpClient() {
        return httpClient;
View Full Code Here

            String redirectUri = header.getValue();

            if ((redirectUri == null) || (redirectUri.equals(""))) {
                redirectUri = "/";
            }
            httpMethod.releaseConnection();
            httpMethod = new GetMethod(redirectUri);

            statusCode = httpClient.executeMethod(httpMethod);
        }
      }
View Full Code Here

      }

      return HttpResponse.error();

    } finally {
      httpMethod.releaseConnection();
    }
  }
}
View Full Code Here

    }
    catch (IOException ex) {
      LOG.error("doHttpCall() failed", ex);
    }
    finally {
      method.releaseConnection();
    }
    return new MethodCallRetVal(-1, "Http " + type + " failed; see log file for details", actualUri, method.getName());
  }
}
View Full Code Here

        HttpMethod method = new GetMethod("http://localhost:9080/users/homer?" + QUERY_STRING);
        try {
            HttpClient client = new HttpClient();
            assertEquals(200, client.executeMethod(method));
        } finally {
            method.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.