本文整理了Java中org.apache.commons.httpclient.HttpHost.getPort()
方法的一些代码示例,展示了HttpHost.getPort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpHost.getPort()
方法的具体详情如下:
包路径:org.apache.commons.httpclient.HttpHost
类名称:HttpHost
方法名:getPort
[英]Returns the port.
[中]返回端口。
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Returns the port.
*
* @return the host port, or -1
if not set
*
* @see #isHostSet()
*/
public synchronized int getPort() {
if (this.host != null) {
return this.host.getPort();
} else {
return -1;
}
}
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Returns the URI of the HTTP method
*
* @return The URI
*
* @throws URIException If the URI cannot be created.
*
* @see org.apache.commons.httpclient.HttpMethod#getURI()
*/
public URI getURI() throws URIException {
StringBuffer buffer = new StringBuffer();
if (this.httphost != null) {
buffer.append(this.httphost.getProtocol().getScheme());
buffer.append("://");
buffer.append(this.httphost.getHostName());
int port = this.httphost.getPort();
if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
buffer.append(":");
buffer.append(port);
}
}
buffer.append(this.path);
if (this.queryString != null) {
buffer.append('?');
buffer.append(this.queryString);
}
String charset = getParams().getUriCharset();
return new URI(buffer.toString(), true, charset);
}
代码示例来源:origin: commons-httpclient/commons-httpclient
return false;
if (this.host.getPort() != connection.getPort()) {
return false;
代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient
/**
* Returns the port.
*
* @return the host port, or -1
if not set
*
* @see #isHostSet()
*/
public synchronized int getPort() {
if (this.host != null) {
return this.host.getPort();
} else {
return -1;
}
}
代码示例来源:origin: org.apache.commons/httpclient
/**
* Returns the port.
*
* @return the host port, or -1
if not set
*
* @see #isHostSet()
*/
public synchronized int getPort() {
if (this.host != null) {
return this.host.getPort();
} else {
return -1;
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient
/**
* Returns the port.
*
* @return the host port, or -1
if not set
*
* @see #isHostSet()
*/
public synchronized int getPort() {
if (this.host != null) {
return this.host.getPort();
} else {
return -1;
}
}
代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient
/**
* Returns the port.
*
* @return the host port, or -1
if not set
*
* @see #isHostSet()
*/
public synchronized int getPort() {
if (this.host != null) {
return this.host.getPort();
} else {
return -1;
}
}
代码示例来源:origin: smartrics/RestFixture
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);
if (queryString != null) {
buffer.append('?');
buffer.append(queryString);
}
String charset = params.getUriCharset();
return new HttpURL(buffer.toString(), charset);
}
代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient
/**
* Returns the URI of the HTTP method
*
* @return The URI
*
* @throws URIException If the URI cannot be created.
*
* @see org.apache.commons.httpclient.HttpMethod#getURI()
*/
public URI getURI() throws URIException {
StringBuffer buffer = new StringBuffer();
if (this.httphost != null) {
buffer.append(this.httphost.getProtocol().getScheme());
buffer.append("://");
buffer.append(this.httphost.getHostName());
int port = this.httphost.getPort();
if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
buffer.append(":");
buffer.append(port);
}
}
buffer.append(this.path);
if (this.queryString != null) {
buffer.append('?');
buffer.append(this.queryString);
}
String charset = getParams().getUriCharset();
return new URI(buffer.toString(), true, charset);
}
代码示例来源:origin: org.zaproxy/zap
/**
* Returns the URI of the HTTP method
*
* @return The URI
*
* @throws URIException If the URI cannot be created.
*
* @see org.apache.commons.httpclient.HttpMethod#getURI()
*/
@Override
public URI getURI() throws URIException {
StringBuffer buffer = new StringBuffer();
if (this.httphost != null) {
buffer.append(this.httphost.getProtocol().getScheme());
buffer.append("://");
buffer.append(this.httphost.getHostName());
int port = this.httphost.getPort();
if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
buffer.append(":");
buffer.append(port);
}
}
buffer.append(this.path);
if (this.queryString != null) {
buffer.append('?');
buffer.append(this.queryString);
}
String charset = getParams().getUriCharset();
return new URI(buffer.toString(), true, charset);
}
代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient
/**
* Returns the URI of the HTTP method
*
* @return The URI
*
* @throws URIException If the URI cannot be created.
*
* @see org.apache.commons.httpclient.HttpMethod#getURI()
*/
public URI getURI() throws URIException {
StringBuffer buffer = new StringBuffer();
if (this.httphost != null) {
buffer.append(this.httphost.getProtocol().getScheme());
buffer.append("://");
buffer.append(this.httphost.getHostName());
int port = this.httphost.getPort();
if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
buffer.append(":");
buffer.append(port);
}
}
buffer.append(this.path);
if (this.queryString != null) {
buffer.append('?');
buffer.append(this.queryString);
}
String charset = getParams().getUriCharset();
return new URI(buffer.toString(), true, charset);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient
/**
* Returns the URI of the HTTP method
*
* @return The URI
*
* @throws URIException If the URI cannot be created.
*
* @see org.apache.commons.httpclient.HttpMethod#getURI()
*/
public URI getURI() throws URIException {
StringBuffer buffer = new StringBuffer();
if (this.httphost != null) {
buffer.append(this.httphost.getProtocol().getScheme());
buffer.append("://");
buffer.append(this.httphost.getHostName());
int port = this.httphost.getPort();
if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
buffer.append(":");
buffer.append(port);
}
}
buffer.append(this.path);
if (this.queryString != null) {
buffer.append('?');
buffer.append(this.queryString);
}
String charset = getParams().getUriCharset();
return new URI(buffer.toString(), true, charset);
}
代码示例来源:origin: org.apache.commons/httpclient
/**
* Returns the URI of the HTTP method
*
* @return The URI
*
* @throws URIException If the URI cannot be created.
*
* @see org.apache.commons.httpclient.HttpMethod#getURI()
*/
public URI getURI() throws URIException {
StringBuffer buffer = new StringBuffer();
if (this.httphost != null) {
buffer.append(this.httphost.getProtocol().getScheme());
buffer.append("://");
buffer.append(this.httphost.getHostName());
int port = this.httphost.getPort();
if (port != -1 && port != this.httphost.getProtocol().getDefaultPort()) {
buffer.append(":");
buffer.append(port);
}
}
buffer.append(this.path);
if (this.queryString != null) {
buffer.append('?');
buffer.append(this.queryString);
}
String charset = getParams().getUriCharset();
return new URI(buffer.toString(), true, charset);
}
代码示例来源:origin: org.mule.transports/mule-transport-http
@Override
public synchronized void setHost(HttpHost host)
{
Protocol newProtocol = cloneProtocolKeepingSocketFactory(host.getProtocol());
HttpHost hostCopy = new HttpHost(host.getHostName(), host.getPort(), newProtocol);
super.setHost(hostCopy);
}
代码示例来源:origin: org.apache.commons/httpclient
return false;
if (this.host.getPort() != connection.getPort()) {
return false;
代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient
return false;
if (this.host.getPort() != connection.getPort()) {
return false;
代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient
return false;
if (this.host.getPort() != connection.getPort()) {
return false;
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient
return false;
if (this.host.getPort() != connection.getPort()) {
return false;
代码示例来源:origin: mesos/hadoop
httpAddress.getHostName() + ':' + httpAddress.getPort());
reportAddress.getHostName() + ':' + reportAddress.getPort());
.newBuilder()
.addRange(Value.Range.newBuilder()
.setBegin(httpAddress.getPort())
.setEnd(httpAddress.getPort()))
.addRange(Value.Range.newBuilder()
.setBegin(reportAddress.getPort())
.setEnd(reportAddress.getPort()))))
.addResources(
Resource