Package org.apache.clerezza.triaxrs.util

Examples of org.apache.clerezza.triaxrs.util.MultivaluedMapImpl


      MediaType mediaType,
      MultivaluedMap<String, String> httpHeaders,
      InputStream entityStream) throws IOException,
      WebApplicationException {

    MultivaluedMap<String, String> map = new MultivaluedMapImpl();
    String string = ProviderUtils.readFromStreamAsString(entityStream, mediaType);
    StringTokenizer tokenizer = new StringTokenizer(string, "&");
    String token;
    while (tokenizer.hasMoreTokens()) {
      token = tokenizer.nextToken();
      int idx = token.indexOf('=');
      if (idx < 0) {
        map.add(URLDecoder.decode(token, "UTF-8"), null);
      } else if (idx > 0) {
        map.add(URLDecoder.decode(token.substring(0, idx), "UTF-8"),
            URLDecoder.decode(token.substring(idx + 1), "UTF-8"));
      }
    }
    return map;
  }
View Full Code Here

TOP

Related Classes of org.apache.clerezza.triaxrs.util.MultivaluedMapImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.