import org.springframework.web.util.UriUtils; //導入方法依賴的package包/類

private URI buildURI(OTXEndpoints endpoint, Map endpointParametersMap) throws URISyntaxException, MalformedURLException {

String endpointString = endpoint.getEndpoint();

if (endpointParametersMap != null) {

boolean first = true;

for (Map.Entry otxEndpointParametersEntry : endpointParametersMap.entrySet()) {

if (otxEndpointParametersEntry.getKey().isRestVariable()) {

endpointString = endpointString.replace("{" + otxEndpointParametersEntry.getKey().getParameterName() + "}", otxEndpointParametersEntry.getValue().toString());

} else {

if (first) {

endpointString = endpointString + "?";

first = false;

}

try {

String parameterName = otxEndpointParametersEntry.getKey().getParameterName();

String value = UriUtils.encodeQueryParam(otxEndpointParametersEntry.getValue().toString(), "UTF-8");

endpointString = endpointString + String.format("%s=%s&", parameterName, value);

} catch (UnsupportedEncodingException e) {

log.error("Unpossible");

}

}

}

}

if (otxPort != null) {

return new URL(otxScheme, otxHost, otxPort, endpointString).toURI();

} else {

return new URL(otxScheme, otxHost, endpointString).toURI();

}

}

python querystring encode_Java UriUtils.encodeQueryParam方法代碼示例相关推荐

  1. python datetime datetime_Python datetime.tzinfo方法代碼示例

    本文整理匯總了Python中datetime.datetime.tzinfo方法的典型用法代碼示例.如果您正苦於以下問題:Python datetime.tzinfo方法的具體用法?Python da ...

  2. python execute_command err_Python management.execute_from_command_line方法代碼示例

    本文整理匯總了Python中django.core.management.execute_from_command_line方法的典型用法代碼示例.如果您正苦於以下問題:Python manageme ...

  3. python template languages_Python template.TemplateSyntaxError方法代碼示例

    本文整理匯總了Python中django.template.TemplateSyntaxError方法的典型用法代碼示例.如果您正苦於以下問題:Python template.TemplateSynt ...

  4. python time strptime_Python time.strptime方法代碼示例

    本文整理匯總了Python中time.strptime方法的典型用法代碼示例.如果您正苦於以下問題:Python time.strptime方法的具體用法?Python time.strptime怎麽 ...

  5. python柱状图zzt_Python torch.diag方法代碼示例

    本文整理匯總了Python中torch.diag方法的典型用法代碼示例.如果您正苦於以下問題:Python torch.diag方法的具體用法?Python torch.diag怎麽用?Python ...

  6. python的concatetate_Python tensorflow.truncated_normal_initializer方法代碼示例

    本文整理匯總了Python中tensorflow.truncated_normal_initializer方法的典型用法代碼示例.如果您正苦於以下問題:Python tensorflow.trunca ...

  7. python turtle color_Python turtle.color方法代碼示例

    本文整理匯總了Python中turtle.color方法的典型用法代碼示例.如果您正苦於以下問題:Python turtle.color方法的具體用法?Python turtle.color怎麽用?P ...

  8. python asyncio future_Python asyncio.ensure_future方法代碼示例

    本文整理匯總了Python中asyncio.ensure_future方法的典型用法代碼示例.如果您正苦於以下問題:Python asyncio.ensure_future方法的具體用法?Python ...

  9. python psutil.disk_Python psutil.disk_partitions方法代碼示例

    本文整理匯總了Python中psutil.disk_partitions方法的典型用法代碼示例.如果您正苦於以下問題:Python psutil.disk_partitions方法的具體用法?Pyth ...

最新文章

  1. 华硕fx80装linux,华硕fx80【解决思路】
  2. [Web API] 如何让 Web API 统一回传格式以及例外处理[转]
  3. 伯努利分布方差_统计知识(4)——分布
  4. Chart Share
  5. JavaWeb-SpringBoot(抖音)_二、服务器间通讯
  6. 微信公众号支付php demo,200行代码实现微信支付-公众号支付,不再踩坑,附:demo...
  7. web.xml(8)_jsp-config
  8. effective python目录_Effective python(七):协作开发
  9. 数据链路层的是三个基本问题
  10. 佛系张小龙和他的微信帝国 | 畅言
  11. 笔记本电脑黑屏但还在运作怎么办
  12. COM学习(四)——COM中的数据类型
  13. 安装floodlight遇到的问题和解决
  14. Tomcat7下配置SSI,同时解决中文乱码问题
  15. redis的简单操作
  16. windows whistler系统安装
  17. 免费分享佳能ir c3320 c3330 c3325彩色复印机中文维修手册
  18. C/C++获取CPU等硬件信息屏幕截图
  19. 把filedia设置为0可以不弹出对话框保存文件
  20. 分享一款光谱分析软件(离线分析软件,导入光谱数据即可分析),功能超级多,超级强大,计算荧光量子效率,发射光谱的拉曼峰,计算共振能量转移(FRET)效率等

热门文章

  1. 完全二叉树的JAVA实现(以及非递归遍历方法)
  2. Blog_Backup:绿色博客备份工具
  3. 「实战篇」开源项目docker化运维部署-后端java部署(七)
  4. android:Activity启动模式
  5. 详细介绍React模态框组件react-modal
  6. 1.1 VMware 一步一步创建虚拟机
  7. Java循环中删除一个列表元素
  8. 专为Android加载图片Fresco:详细图解SimpleDraweeView加载图片基础
  9. PHP将json或对象转成数组
  10. 让博客园的编辑器自动上传外链图片