> +/**
> + * 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);
> +   }
> +
> +   static String unquote(String eTag) {
> +      if (eTag.length() >= 2 &&
> +          eTag.startsWith("\"") && eTag.endsWith("\"")) {
> +         eTag = eTag.substring(1, eTag.length() - 1);
> +      }

Can you do this using Splitter or a regex? Also, you're testing for len > 2 - 
any need for that? Is a single `"` a valid input?

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

Reply via email to