code: protected static String removeQuotes(String quotedString, boolean quotesRequired) {
          // support both quoted and non-quoted
          if (quotedString.length() > 0 && quotedString.charAt(0) != '"' && !quotesRequired) {
              return quotedString;
          } else if (quotedString.length() > 2) {
              return quotedString.substring(1, quotedString.length() - 1);
          } else {
              return "";
          }
      }
docs: Removes the quotes on a string. RFC2617 states quotes are optional for all parameters except realm.