本文整理了Java中org.apache.commons.httpclient.HttpConnection.getProxyPort()
方法的一些代码示例,展示了HttpConnection.getProxyPort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpConnection.getProxyPort()
方法的具体详情如下:
包路径:org.apache.commons.httpclient.HttpConnection
类名称:HttpConnection
方法名:getProxyPort
[英]Returns the port of the proxy host.
[中]返回代理主机的端口。
代码示例来源:origin: commons-httpclient/commons-httpclient
public int getProxyPort() {
if (hasConnection()) {
return wrappedConnection.getProxyPort();
} else {
return -1;
}
}
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Tests if the proxy configuration equals the configuration set on the
* connection. True only if the proxyHost and proxyPort are equal.
*
* @param connection the connection to test against
* @return <code>true</code> if the connection's proxy information equals that of this
* configuration
*
* @see #hostEquals(HttpConnection)
*/
public synchronized boolean proxyEquals(final HttpConnection connection) {
if (connection == null) {
throw new IllegalArgumentException("Connection may not be null");
}
if (this.proxyHost != null) {
return
this.proxyHost.getHostName().equalsIgnoreCase(connection.getProxyHost())
&& this.proxyHost.getPort() == connection.getProxyPort();
} else {
return connection.getProxyHost() == null;
}
}
代码示例来源:origin: commons-httpclient/commons-httpclient
conn.getProxyHost(), conn.getProxyPort(),
authscheme.getRealm(),
authscheme.getSchemeName());
代码示例来源:origin: commons-httpclient/commons-httpclient
conn.getProxyHost(), conn.getProxyPort(),
authscheme.getRealm(),
authscheme.getSchemeName());
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Gets the host configuration for a connection.
* @param conn the connection to get the configuration of
* @return a new HostConfiguration
*/
private HostConfiguration configurationForConnection(HttpConnection conn) {
HostConfiguration connectionConfiguration = new HostConfiguration();
connectionConfiguration.setHost(
conn.getHost(),
conn.getPort(),
conn.getProtocol()
);
if (conn.getLocalAddress() != null) {
connectionConfiguration.setLocalAddress(conn.getLocalAddress());
}
if (conn.getProxyHost() != null) {
connectionConfiguration.setProxy(conn.getProxyHost(), conn.getProxyPort());
}
return connectionConfiguration;
}
代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient
public int getProxyPort() {
if (hasConnection()) {
return wrappedConnection.getProxyPort();
} else {
return -1;
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient
public int getProxyPort() {
if (hasConnection()) {
return wrappedConnection.getProxyPort();
} else {
return -1;
}
}
代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient
public int getProxyPort() {
if (hasConnection()) {
return wrappedConnection.getProxyPort();
} else {
return -1;
}
}
代码示例来源:origin: org.sonatype.nexus/nexus-proxy
public int getProxyPort() {
if (hasConnection()) {
return wrappedConnection.getProxyPort();
} else {
return -1;
}
}
代码示例来源:origin: org.apache.commons/httpclient
public int getProxyPort() {
if (hasConnection()) {
return wrappedConnection.getProxyPort();
} else {
return -1;
}
}
代码示例来源:origin: org.apache.commons/httpclient
/**
* Tests if the proxy configuration equals the configuration set on the
* connection. True only if the proxyHost and proxyPort are equal.
*
* @param connection the connection to test against
* @return <code>true</code> if the connection's proxy information equals that of this
* configuration
*
* @see #hostEquals(HttpConnection)
*/
public synchronized boolean proxyEquals(final HttpConnection connection) {
if (connection == null) {
throw new IllegalArgumentException("Connection may not be null");
}
if (this.proxyHost != null) {
return
this.proxyHost.getHostName().equalsIgnoreCase(connection.getProxyHost())
&& this.proxyHost.getPort() == connection.getProxyPort();
} else {
return connection.getProxyHost() == null;
}
}
代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient
/**
* Tests if the proxy configuration equals the configuration set on the
* connection. True only if the proxyHost and proxyPort are equal.
*
* @param connection the connection to test against
* @return <code>true</code> if the connection's proxy information equals that of this
* configuration
*
* @see #hostEquals(HttpConnection)
*/
public synchronized boolean proxyEquals(final HttpConnection connection) {
if (connection == null) {
throw new IllegalArgumentException("Connection may not be null");
}
if (this.proxyHost != null) {
return
this.proxyHost.getHostName().equalsIgnoreCase(connection.getProxyHost())
&& this.proxyHost.getPort() == connection.getProxyPort();
} else {
return connection.getProxyHost() == null;
}
}
代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient
/**
* Tests if the proxy configuration equals the configuration set on the
* connection. True only if the proxyHost and proxyPort are equal.
*
* @param connection the connection to test against
* @return <code>true</code> if the connection's proxy information equals that of this
* configuration
*
* @see #hostEquals(HttpConnection)
*/
public synchronized boolean proxyEquals(final HttpConnection connection) {
if (connection == null) {
throw new IllegalArgumentException("Connection may not be null");
}
if (this.proxyHost != null) {
return
this.proxyHost.getHostName().equalsIgnoreCase(connection.getProxyHost())
&& this.proxyHost.getPort() == connection.getProxyPort();
} else {
return connection.getProxyHost() == null;
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient
/**
* Tests if the proxy configuration equals the configuration set on the
* connection. True only if the proxyHost and proxyPort are equal.
*
* @param connection the connection to test against
* @return <code>true</code> if the connection's proxy information equals that of this
* configuration
*
* @see #hostEquals(HttpConnection)
*/
public synchronized boolean proxyEquals(final HttpConnection connection) {
if (connection == null) {
throw new IllegalArgumentException("Connection may not be null");
}
if (this.proxyHost != null) {
return
this.proxyHost.getHostName().equalsIgnoreCase(connection.getProxyHost())
&& this.proxyHost.getPort() == connection.getProxyPort();
} else {
return connection.getProxyHost() == null;
}
}
代码示例来源:origin: org.apache.commons/httpclient
conn.getProxyHost(), conn.getProxyPort(),
authscheme.getRealm(),
authscheme.getSchemeName());
代码示例来源:origin: org.sonatype.nexus/nexus-proxy
/**
* Gets the host configuration for a connection.
* @param conn the connection to get the configuration of
* @return a new HostConfiguration
*/
private HostConfiguration configurationForConnection(HttpConnection conn) {
HostConfiguration connectionConfiguration = new HostConfiguration();
connectionConfiguration.setHost(
conn.getHost(),
conn.getPort(),
conn.getProtocol()
);
if (conn.getLocalAddress() != null) {
connectionConfiguration.setLocalAddress(conn.getLocalAddress());
}
if (conn.getProxyHost() != null) {
connectionConfiguration.setProxy(conn.getProxyHost(), conn.getProxyPort());
}
return connectionConfiguration;
}
代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient
/**
* Gets the host configuration for a connection.
* @param conn the connection to get the configuration of
* @return a new HostConfiguration
*/
private HostConfiguration configurationForConnection(HttpConnection conn) {
HostConfiguration connectionConfiguration = new HostConfiguration();
connectionConfiguration.setHost(
conn.getHost(),
conn.getPort(),
conn.getProtocol()
);
if (conn.getLocalAddress() != null) {
connectionConfiguration.setLocalAddress(conn.getLocalAddress());
}
if (conn.getProxyHost() != null) {
connectionConfiguration.setProxy(conn.getProxyHost(), conn.getProxyPort());
}
return connectionConfiguration;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient
/**
* Gets the host configuration for a connection.
* @param conn the connection to get the configuration of
* @return a new HostConfiguration
*/
private HostConfiguration configurationForConnection(HttpConnection conn) {
HostConfiguration connectionConfiguration = new HostConfiguration();
connectionConfiguration.setHost(
conn.getHost(),
conn.getPort(),
conn.getProtocol()
);
if (conn.getLocalAddress() != null) {
connectionConfiguration.setLocalAddress(conn.getLocalAddress());
}
if (conn.getProxyHost() != null) {
connectionConfiguration.setProxy(conn.getProxyHost(), conn.getProxyPort());
}
return connectionConfiguration;
}
代码示例来源:origin: org.apache.commons/httpclient
/**
* Gets the host configuration for a connection.
* @param conn the connection to get the configuration of
* @return a new HostConfiguration
*/
private HostConfiguration configurationForConnection(HttpConnection conn) {
HostConfiguration connectionConfiguration = new HostConfiguration();
connectionConfiguration.setHost(
conn.getHost(),
conn.getPort(),
conn.getProtocol()
);
if (conn.getLocalAddress() != null) {
connectionConfiguration.setLocalAddress(conn.getLocalAddress());
}
if (conn.getProxyHost() != null) {
connectionConfiguration.setProxy(conn.getProxyHost(), conn.getProxyPort());
}
return connectionConfiguration;
}
代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient
/**
* Gets the host configuration for a connection.
* @param conn the connection to get the configuration of
* @return a new HostConfiguration
*/
private HostConfiguration configurationForConnection(HttpConnection conn) {
HostConfiguration connectionConfiguration = new HostConfiguration();
connectionConfiguration.setHost(
conn.getHost(),
conn.getPort(),
conn.getProtocol()
);
if (conn.getLocalAddress() != null) {
connectionConfiguration.setLocalAddress(conn.getLocalAddress());
}
if (conn.getProxyHost() != null) {
connectionConfiguration.setProxy(conn.getProxyHost(), conn.getProxyPort());
}
return connectionConfiguration;
}
内容来源于网络,如有侵权,请联系作者删除!