热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.commons.httpclient.HttpHost.getPort()方法的使用及代码示例

本文整理了Java中org.apache.commons.httpclient.HttpHost.getPort()方法的一些代码示例,展示了HttpHos

本文整理了Java中org.apache.commons.httpclient.HttpHost.getPort()方法的一些代码示例,展示了HttpHost.getPort()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpHost.getPort()方法的具体详情如下:
包路径:org.apache.commons.httpclient.HttpHost
类名称:HttpHost
方法名:getPort

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

推荐阅读
  • 个人学习使用:谨慎参考1Client类importcom.thoughtworks.gauge.Step;importcom.thoughtworks.gauge.T ... [详细]
  • Java太阳系小游戏分析和源码详解
    本文介绍了一个基于Java的太阳系小游戏的分析和源码详解。通过对面向对象的知识的学习和实践,作者实现了太阳系各行星绕太阳转的效果。文章详细介绍了游戏的设计思路和源码结构,包括工具类、常量、图片加载、面板等。通过这个小游戏的制作,读者可以巩固和应用所学的知识,如类的继承、方法的重载与重写、多态和封装等。 ... [详细]
  • 本文介绍了一个Java猜拳小游戏的代码,通过使用Scanner类获取用户输入的拳的数字,并随机生成计算机的拳,然后判断胜负。该游戏可以选择剪刀、石头、布三种拳,通过比较两者的拳来决定胜负。 ... [详细]
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • 本文介绍了在Mac上搭建php环境后无法使用localhost连接mysql的问题,并通过将localhost替换为127.0.0.1或本机IP解决了该问题。文章解释了localhost和127.0.0.1的区别,指出了使用socket方式连接导致连接失败的原因。此外,还提供了相关链接供读者深入了解。 ... [详细]
  • 关键词:Golang, Cookie, 跟踪位置, net/http/cookiejar, package main, golang.org/x/net/publicsuffix, io/ioutil, log, net/http, net/http/cookiejar ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • 本文介绍了一些Java开发项目管理工具及其配置教程,包括团队协同工具worktil,版本管理工具GitLab,自动化构建工具Jenkins,项目管理工具Maven和Maven私服Nexus,以及Mybatis的安装和代码自动生成工具。提供了相关链接供读者参考。 ... [详细]
  • 本文介绍了一个适用于PHP应用快速接入TRX和TRC20数字资产的开发包,该开发包支持使用自有Tron区块链节点的应用场景,也支持基于Tron官方公共API服务的轻量级部署场景。提供的功能包括生成地址、验证地址、查询余额、交易转账、查询最新区块和查询交易信息等。详细信息可参考tron-php的Github地址:https://github.com/Fenguoz/tron-php。 ... [详细]
  • 大数据Hadoop生态(20)MapReduce框架原理OutputFormat的开发笔记
    本文介绍了大数据Hadoop生态(20)MapReduce框架原理OutputFormat的开发笔记,包括outputFormat接口实现类、自定义outputFormat步骤和案例。案例中将包含nty的日志输出到nty.log文件,其他日志输出到other.log文件。同时提供了一些相关网址供参考。 ... [详细]
  • 本文讨论了在shiro java配置中加入Shiro listener后启动失败的问题。作者引入了一系列jar包,并在web.xml中配置了相关内容,但启动后却无法正常运行。文章提供了具体引入的jar包和web.xml的配置内容,并指出可能的错误原因。该问题可能与jar包版本不兼容、web.xml配置错误等有关。 ... [详细]
  • 本文介绍了解决Netty拆包粘包问题的一种方法——使用特殊结束符。在通讯过程中,客户端和服务器协商定义一个特殊的分隔符号,只要没有发送分隔符号,就代表一条数据没有结束。文章还提供了服务端的示例代码。 ... [详细]
  • Mac OS 升级到11.2.2 Eclipse打不开了,报错Failed to create the Java Virtual Machine
    本文介绍了在Mac OS升级到11.2.2版本后,使用Eclipse打开时出现报错Failed to create the Java Virtual Machine的问题,并提供了解决方法。 ... [详细]
  • 本文讨论了一个数列求和问题,该数列按照一定规律生成。通过观察数列的规律,我们可以得出求解该问题的算法。具体算法为计算前n项i*f[i]的和,其中f[i]表示数列中有i个数字。根据参考的思路,我们可以将算法的时间复杂度控制在O(n),即计算到5e5即可满足1e9的要求。 ... [详细]
author-avatar
敏佳的晴__丶天
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有