> +        try {
> +            String encoded = URLEncoder.encode(value, DEFAULT_ENCODING);
> +
> +            Matcher matcher = ENCODED_CHARACTERS_PATTERN.matcher(encoded);
> +            StringBuffer buffer = new StringBuffer(encoded.length());
> +
> +            while (matcher.find()) {
> +                String replacement = matcher.group(0);
> +
> +                if ("+".equals(replacement)) {
> +                    replacement = "%20";
> +                } else if ("*".equals(replacement)) {
> +                    replacement = "%2A";
> +                } else if ("%7E".equals(replacement)) {
> +                    replacement = "~";
> +                }

UrlEscapers.urlFormParameterEscaper isn's same as this urlEncode.
* URI encode every byte except the unreserved characters: 'A'-'Z', 'a'-'z', 
'0'-'9', '-', '.', '_', and '~'.
* The space character is a reserved character and must be encoded as "%20" (and 
not as "+").
* Each Uri-encoded byte is formed by a '%' and the two-digit hexadecimal value 
of the byte.
* Letters in the hexadecimal value must be uppercase, for example "%1A".
* Encode the forward slash character, '/', everywhere except in the object key 
name. For example, if the object key name is photos/Jan/sample.jpg, the forward 
slash in the key name is not encoded. 

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

Reply via email to