apache-camel - 如何使用 Apache camel RAW(value) 作为密码
问题描述
当我们使用 URI 配置 Camel 端点时,默认情况下参数值会获取 url 编码。当我们想按原样配置密码时,这可能是一个问题。
为此,我们可以告诉 Camel 使用原始值,方法是用 RAW(value) 将值括起来。 http://camel.apache.org/how-do-i-configure-endpoints.html
但这不适用于邮件端点 URI。
这是代码。
public String getURL()
{
String url = "";
try{
URI uri = new URI(this.emailServer.toString());
url = "imaps://"+uri.getHost()+"?username="+this.username+"&password=RAW("+this.password+")&folderName="+this.getMailBox()+"©To="+this.getMailBox()";
} catch (Exception ex){
ex.printStackTrace();
}
return url;
}
但它工作正常 aws 端点
public String getURL(){
String fromURL = "";
fromURL = "aws-sqs://" + getQueueName() + "?accessKey=" + getS3AccessKey() + "&secretKey=RAW(" + getS3SecretKey() + ")®ion=" + getQueueRegion() + "&queueOwnerAWSAccountId=" + getS3SQSAWSClientID();
return fromURL;
}
任何想法?
解决方案
推荐阅读
- mysql - 使用 DBI 在 R 中进行日期循环查询
- database - 为什么准备好的语句不允许字段和表名作为参数?
- macos - Tmux 2.6 鼠标控制在 MacOS 10.13 终端中不起作用
- json - JSON 文件有什么作用?
- hidden-markov-models - 具有连续和离散发射概率的隐马尔可夫模型
- mongodb - 当数组中的项目存在于另一个集合中时,如何在两个集合之间进行查找?
- linear-algebra - 在 MathNet.Numerics.LinearAlgebra.Vector 的底部添加 1
- android - 如何在 Visual Studio Team Services 上设置 Android 构建
- json - 隐藏 django json api 数据不让公众查看
- python - Python 3:每 4 个单词检查用户输入的语法是否正确