class RequestUtils {

  public static MultiValueMap<String, String> getQueryStringParameters(HttpServletRequest request) {
    // Manually parse the query string rather than use HttpServletRequest#getParameter so that
    // the message body remains intact and available.  Calling HttpServletRequest#getParameter
    // could interfere with processing the body of this request later since the body needs to be
    // parsed to find any form parameters.
    String queryString = request.getQueryString();
    return (StringUtils.isEmpty(queryString))
        ? null
        : UriComponentsBuilder.newInstance().query(queryString).build().getQueryParams();
  }

}