/** * Valid input are <code>;</code> separated <code>key=value</code> pairs * without spaces between key and value. * <p> * See RFC 7231: * The type, subtype, and parameter name tokens are case-insensitive. * Parameter values might or might not be case-sensitive, depending on * the semantics of the parameter name. The presence or absence of a * parameter might be significant to the processing of a media-type, * depending on its definition within the media type registry. * </p> * * @param parameters as <code>;</code> separated <code>key=value</code> pairs * @param parameterMap map to which all parsed parameters are added */ static void parseParameters(final String parameters, final Map<String, String> parameterMap) { if (parameters != null) { for (String parameter : parameters.split(TypeUtil.PARAMETER_SEPARATOR)) { final String[] keyValue = parseParameter(parameter); parameterMap.put(keyValue[0], keyValue[1]); } } }
/** * Valid input are <code>;</code> separated <code>key=value</code> pairs * without spaces between key and value. * <p> * See RFC 7231: * The type, subtype, and parameter name tokens are case-insensitive. * Parameter values might or might not be case-sensitive, depending on * the semantics of the parameter name. The presence or absence of a * parameter might be significant to the processing of a media-type, * depending on its definition within the media type registry. * </p> * * @param parameters as <code>;</code> separated <code>key=value</code> pairs * @param parameterMap map to which all parsed parameters are added */ static void parseParameters(final String parameters, final Map<String, String> parameterMap) { if (parameters != null) { for (String parameter : parameters.split(TypeUtil.PARAMETER_SEPARATOR)) { final String[] keyValue = parseParameter(parameter); parameterMap.put(keyValue[0], keyValue[1]); } } }