code: protected static Map<String, String> getParameters(String list, Map<String, String> params) throws ParseException {
          HeaderTokenizer tokenizer = new HeaderTokenizer(list);
          while (true) {
              Token token = tokenizer.next();
              switch (token.getType()) {
                  case Token.EOF:
                      // the EOF token terminates parsing.
                      return params;
  
                  case ';':
                      // each new parameter is separated by a semicolon, including
                      // the first, which separates
                      // the parameters from the main part of the header.
                      // the next token needs to be a parameter name
                      token = tokenizer.next();
                      // allow a trailing semicolon on the parameters.
                      if (token.getType() == Token.EOF) {
                          return params;
                      }
  
                      if (token.getType() != Token.ATOM) {
                          throw new ParseException("Invalid parameter name: " + token.getValue());
                      }
  
                      // get the parameter name as a lower case version for better
                      // mapping.
                      String name = token.getValue().toLowerCase(Locale.ENGLISH);
  
                      token = tokenizer.next();
  
                      // parameters are name=value, so we must have the "=" here.
                      if (token.getType() != '=') {
                          throw new ParseException("Missing '='");
                      }
  
                      // now the value, which may be an atom or a literal
                      token = tokenizer.next();
  
                      if (token.getType() != Token.ATOM && token.getType() != Token.QUOTEDSTRING) {
                          throw new ParseException("Invalid parameter value: " + token.getValue());
                      }
  
                      String value = token.getValue();
  
                      // we might have to do some additional decoding. A name that
                      // ends with "*" is marked as being encoded, so if requested, we
                      // decode the value.
                      if (name.endsWith("*")) {
                          name = name.substring(0, name.length() - 1);
                          value = decodeRFC2231value(value);
                      }
                      params.put(name, value);
                      break;
                  default:
                      throw new ParseException("Missing ';'");
              }
          }
      }
docs: /*
  Tweaked from geronimo-javamail_1.4_spec-1.7.1. ParameterList