Example usage for org.apache.commons.httpclient.params HttpParams isParameterSet

List of usage examples for org.apache.commons.httpclient.params HttpParams isParameterSet

Introduction

In this page you can find the example usage for org.apache.commons.httpclient.params HttpParams isParameterSet.

Prototype

public abstract boolean isParameterSet(String paramString);

Source Link

Usage

From source file:org.apache.ode.axis2.httpbinding.ProxyConf.java

/**
 * @return true if a proxy is set in the params, or in the system property "http.proxyHost"
 * and the host is not mentionnned in the system property "http.nonProxyHosts"
 * @see Properties#PROP_HTTP_PROXY_PREFIX
 *///  w  w  w.j  ava2s .  c o m
public static boolean isProxyEnabled(HttpParams params, String targetHost) throws URIException {
    // from IL properties
    boolean isSet = params.isParameterSet(Properties.PROP_HTTP_PROXY_PREFIX);
    // from Java Networking Properties
    isSet |= System.getProperty(HTTP_PROXY_HOST) != null;

    boolean isNonProxyHost = isNonProxyHost(targetHost);
    return isSet && !isNonProxyHost;
}