> +
> +   protected String ifNotEmpty(String pattern, Object param) {
> +      try {
> +      return Strings.isNullOrEmpty((String) param) ? "" : 
> String.format(pattern, param);
> +      } catch (ClassCastException ex) {
> +      return Strings.isNullOrEmpty(param.toString()) ? "" : 
> String.format(pattern, param);
> +      }
> +   }
> +
> +   protected String ifNotNull(Object object) {
> +      return object == null ? "" : object.toString();
> +   }
> +
> +   protected <R extends HttpRequest> R createRequest(R fromRequest, String 
> payload) {
> +      fromRequest.setPayload(payload);
> +      
> fromRequest.getPayload().getContentMetadata().setContentType(MediaType.TEXT_XML);

It would be also good to set the content length here, if known.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/72/files#r22133732

Reply via email to