Skip to content

Commit

Permalink
CAMEL-10164: Polished
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus committed Sep 5, 2016
1 parent 642128b commit e097a5d
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -39,7 +39,7 @@ public class RestProducer extends DefaultAsyncProducer {
// the producer of the Camel component that is used as the HTTP client to call the REST service // the producer of the Camel component that is used as the HTTP client to call the REST service
private AsyncProcessor producer; private AsyncProcessor producer;


private boolean preapreUriTemplate = true; private boolean prepareUriTemplate = true;


public RestProducer(Endpoint endpoint, Producer producer) { public RestProducer(Endpoint endpoint, Producer producer) {
super(endpoint); super(endpoint);
Expand All @@ -66,16 +66,16 @@ public RestEndpoint getEndpoint() {
return (RestEndpoint) super.getEndpoint(); return (RestEndpoint) super.getEndpoint();
} }


public boolean isPreapreUriTemplate() { public boolean isPrepareUriTemplate() {
return preapreUriTemplate; return prepareUriTemplate;
} }


/** /**
* Whether to prepare the uri template and replace {key} with values from the exchange, and set * Whether to prepare the uri template and replace {key} with values from the exchange, and set
* as {@link Exchange#HTTP_URI} header with the resolved uri to use instead of uri from endpoint. * as {@link Exchange#HTTP_URI} header with the resolved uri to use instead of uri from endpoint.
*/ */
public void setPreapreUriTemplate(boolean preapreUriTemplate) { public void setPrepareUriTemplate(boolean prepareUriTemplate) {
this.preapreUriTemplate = preapreUriTemplate; this.prepareUriTemplate = prepareUriTemplate;
} }


protected void prepareExchange(Exchange exchange) throws Exception { protected void prepareExchange(Exchange exchange) throws Exception {
Expand All @@ -85,7 +85,7 @@ protected void prepareExchange(Exchange exchange) throws Exception {
// uri template may be optional and the user have entered the uri template in the path instead // uri template may be optional and the user have entered the uri template in the path instead
String resolvedUriTemplate = getEndpoint().getUriTemplate() != null ? getEndpoint().getUriTemplate() : getEndpoint().getPath(); String resolvedUriTemplate = getEndpoint().getUriTemplate() != null ? getEndpoint().getUriTemplate() : getEndpoint().getPath();


if (preapreUriTemplate) { if (prepareUriTemplate) {
if (resolvedUriTemplate.contains("{")) { if (resolvedUriTemplate.contains("{")) {
// resolve template and replace {key} with the values form the exchange // resolve template and replace {key} with the values form the exchange
// each {} is a parameter (url templating) // each {} is a parameter (url templating)
Expand Down

0 comments on commit e097a5d

Please sign in to comment.