When we configure Camel endpoints using URIs then the parameter values gets url encoded by default. This can be a problem when we want to configure passwords as is.
To do that we can tell Camel to use the raw value, by enclosing the value with RAW(value). http://camel.apache.org/how-do-i-configure-endpoints.html
But this is not working for mail endpoint URI.
Here is the code.
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;
}
But it is working fine aws endpoint
public String getURL(){
String fromURL = "";
fromURL = "aws-sqs://" + getQueueName() + "?accessKey=" + getS3AccessKey() + "&secretKey=RAW(" + getS3SecretKey() + ")®ion=" + getQueueRegion() + "&queueOwnerAWSAccountId=" + getS3SQSAWSClientID();
return fromURL;
}
Any idea?