code: private static Map<String, String> genericNameValueProcess(String s) {
          Map<String, String> params = new HashMap<String, String>();
          List<String> parameters = split(s, ";");
          for (String parameter : parameters) {
              List<String> parts = split(parameter, "=");
              // do a check, otherwise we might get NPE
              if (parts.size() == 2) {
                  String second = parts.get(1).trim();
                  if (second.startsWith("\"") && second.endsWith("\""))
                      second = second.substring(1, second.length() - 1);
  
                  String first = parts.get(0).trim();
  
                  // make sure for directives we clear out any space as in "directive  :=value"
                  if (first.endsWith(":")) {
                      first = first.substring(0, first.length() - 1).trim() + ":";
                  }
  
                  params.put(first, second);
              }
          }
  
          return params;
      }
docs: Internal method to parse headers with the format<p>
  [attribute-name]=[attribute-value](;[attribute-name]=[attribute-value])*<br>
  Eg.<br>
  thing=value;other=something<br>
  <p>
  Note. Directives (name:=value) are represented in the map with name suffixed by ':'
  
  @param s data to parse
  @return a NameValueMap, with attribute-name -> attribute-value.