Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpHost


*/
class URIBuilder {

  public URI getURI(String scheme, String host, int port, String path,
      String queryString, HttpMethodParams params) throws URIException {
    HttpHost httphost = new HttpHost(host, port);
    StringBuffer buffer = new StringBuffer();
    if (httphost != null) {
      buffer.append(httphost.getProtocol().getScheme());
      buffer.append("://");
      buffer.append(httphost.getHostName());
      int p = httphost.getPort();
      if (p != -1 && p != httphost.getProtocol().getDefaultPort()) {
        buffer.append(":");
        buffer.append(p);
      }
    }
    buffer.append(path);
View Full Code Here


  @SuppressWarnings("deprecation")
  public void setURI(org.apache.commons.httpclient.HttpMethodBase m, URI uri)
      throws URIException {
    HostConfiguration conf = m.getHostConfiguration();
    if (uri.isAbsoluteURI()) {
      conf.setHost(new HttpHost(uri));
      m.setHostConfiguration(conf);
    }
    m.setPath(uri.getPath() != null ? uri.getEscapedPath() : "/");
    m.setQueryString(uri.getQuery());
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.HttpHost

Copyright © 2018 www.massapicom. 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.