> +
> +import static com.google.common.io.BaseEncoding.base16;
> +
> +/**
> + * Converts ETag header values to byte arrays.
> + *
> + * @author Francis Devereux
> + */
> +public class ETagUtils {
> +   public static byte[] convertETagToHash(String eTag) {
> +      eTag = unquote(eTag);
> +      return base16().lowerCase().decode(eTag);
> +   }
> +
> +   private static String unquote(String eTag) {
> +      if (eTag.startsWith("\"") && eTag.endsWith("\"")) {

I've added that check so unquote() no longer throws an exception when you pass 
it a single " character. I don't think there's anything we can do to stop 
convertETagToHash() barfing on that input though.


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

Reply via email to