Example usage for org.apache.commons.httpclient HttpHost getProtocol

List of usage examples for org.apache.commons.httpclient HttpHost getProtocol

Introduction

In this page you can find the example usage for org.apache.commons.httpclient HttpHost getProtocol.

Prototype

public Protocol getProtocol() 

Source Link

Usage

From source file:org.mule.transport.http.MuleHostConfiguration.java

@Override
public synchronized void setHost(HttpHost host) {
    Protocol newProtocol = cloneProtocolKeepingSocketFactory(host.getProtocol());

    HttpHost hostCopy = new HttpHost(host.getHostName(), host.getPort(), newProtocol);
    super.setHost(hostCopy);
}

From source file:pt.webdetails.browserid.spring.BrowserIdProcessingFilter.java

@Override
public void afterPropertiesSet() throws Exception {
    super.afterPropertiesSet();
    //request parameters
    Assert.hasLength(getAssertionParameterName(), "assertionParameterName cannot be empty.");
    //    Assert.hasLength(getAudienceParameterName(), "audienceParameterName cannot be empty.");

    //check URL/* w  w w . j  a v a  2  s .c om*/
    Assert.hasLength(getVerificationServiceUrl());
    try {
        HttpHost host = new HttpHost(new URI(getVerificationServiceUrl(), false));
        Assert.isTrue(host.getProtocol().isSecure(), "verificationServiceUrl does not use a secure protocol");
    } catch (URIException e) {
        throw new IllegalArgumentException("verificationServiceUrl is not a valid URI", e);
    }
}

From source file:smartrics.rest.fitnesse.fixture.support.http.URIBuilder.java

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);//from  w  w w. j a va  2  s .c  om
        }
    }
    buffer.append(path);
    if (queryString != null) {
        buffer.append('?');
        buffer.append(queryString);
    }
    String charset = params.getUriCharset();
    return new HttpURL(buffer.toString(), charset);
}