Package org.apache.commons.httpclient

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


      throw e;
    }
    finally
    {
      closeInputStream(is);
      method.releaseConnection();
    }
    return result;
  }

  /**
 
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

        }
        SimpleHtmlParser parser = new SimpleHtmlParser(body);
        if (!parser.isValidHtml()) { // this is not valid HTML, deliver
          // asynchronuous
        }
        meth.releaseConnection();
        htmlHead = parser.getHtmlHead();
        jsOnLoad = parser.getJsOnLoad();
        htmlContent = parser.getHtmlContent();
      } else {
        htmlContent = "Error: cannot display inline :"+tureq.getUri()+": mime type was '" + mimeType +
View Full Code Here

      SimpleHtmlParser parser = new SimpleHtmlParser(body);
      if (!parser.isValidHtml()) { // this is not valid HTML, deliver
        // asynchronuous
        return new HttpRequestMediaResource(meth);
      }
      meth.releaseConnection();
      htmlHead = parser.getHtmlHead();
      jsOnLoad = parser.getJsOnLoad();
      htmlContent = parser.getHtmlContent();
      setDirty(true);
    } else return new HttpRequestMediaResource(meth); // this is a async browser
View Full Code Here

    try {
      client.executeMethod(meth);
      return meth;
    } catch (Exception e) {
      meth.releaseConnection();
    }
    return null;
  }

  /**
 
View Full Code Here

            // handle error later
          }
 
          if (!ok) {
            // error
            meth.releaseConnection();
            return new NotFoundMediaResource(relPath);
          }
 
          // get or post successfully
          Header responseHeader = meth.getResponseHeader("Content-Type");
View Full Code Here

        method = new GetMethod(url);
        int status = httpClient.executeMethod(method);
        assertEquals(HttpStatus.SC_OK, status);
        String result = method.getResponseBodyAsString();
        assertTrue(result.contains("hello"));
        method.releaseConnection();
       
        httpClient = createClient();
        url = "http://localhost:" + PORT + "/Echo/echo/echo/hello?wsdl";
        method = new GetMethod(url);
        status = httpClient.executeMethod(method);
View Full Code Here

        method = new GetMethod(url);
        int status = httpClient.executeMethod(method);
        assertEquals(HttpStatus.SC_OK, status);
        String result = method.getResponseBodyAsString();
        assertTrue(result.contains("hello"));
        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.