Package org.apache.commons.httpclient

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


            throw new CarbonException("Could not get the convert the content of " + urlString +
                                      " to XML. You may have " +
                                      "to use the scraper object to get this url and tidy it");
        } finally {
            // Release the connection.
            method.releaseConnection();
        }
    }

    /**
     * setTimeout() allows you to specify that a piece of JavaScript code (called an expression) will be run a specified number
View Full Code Here


        } catch (IOException e) {
            String msg = "Error while reading content from the URL in system.getJSON()";
            log.error(msg, e);
            throw new CarbonException(msg, e);
        } finally {
            method.releaseConnection();
            if (bufferedReader != null) {
                try {
                    bufferedReader.close();
                } catch (IOException e) {
                    log.warn("Error closing BufferedReader", e);
View Full Code Here

          if (httpMethod != null) {
              try {
                  if (httpMethod.getResponseBodyAsStream() == null ||
                        !(httpMethod.getResponseBodyAsStream().available() <= 0)) {

                    httpMethod.releaseConnection();
                  }
              } catch (IOException ignore) {
                    httpMethod.releaseConnection();
              }
          }
View Full Code Here

                        !(httpMethod.getResponseBodyAsStream().available() <= 0)) {

                    httpMethod.releaseConnection();
                  }
              } catch (IOException ignore) {
                    httpMethod.releaseConnection();
              }
          }
      }
  }
View Full Code Here

            inputStream = httpMethod.getResponseBodyAsStream();
            return getStub(type, inputStream, url);           
        } catch (IOException e) {
            throw new CarbonException(e);
        } finally {
            httpMethod.releaseConnection();
        }
    }

    private String getStub(String type, InputStream inputStream, String uri)
            throws CarbonException {
View Full Code Here

            String message = "Error occurred while reading the WSDL content from the URL : " + wsdlURL;
            log.error(message, e);
            throw new CarbonException(message, e);
        } finally {
            // Release the connection.
            method.releaseConnection();
        }
        return optionsArray;
    }

    private static String getObjectProperty(NativeObject object, String property) {
View Full Code Here

            LOG.warn("Exception while handling server", ioe);
            request.handleError(server);
        } finally {
            // release the connection.
            if (get != null) {
                get.releaseConnection();
                get.abort();
            }
        }
    }
View Full Code Here

         SSOBaseCase.checkAccessDenied(this.httpConn, baseURLNoAuth + "war2/index.html");
      }
      finally
      {
         if(indexGet != null)
           indexGet.releaseConnection();
      }
      // try to perform programmatic auth with no valid username/password.
      path = path + "?operation=login&username=dummy&pass=dummy";
      try
      {
View Full Code Here

         SSOBaseCase.checkAccessDenied(this.httpConn, baseURLNoAuth + "war2/index.html");
      }
      finally
      {
         if(indexGet != null)
           indexGet.releaseConnection();
      }
   }
  
   /**
    * Test Successful programmatic login in a servlet
View Full Code Here

      finally
      {
         if(indexGet != null)
           indexGet.releaseConnection();
         if(indexGet2 != null)
           indexGet2.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.