Class QueryStringDecoder

java.lang.Object
com.linkedin.alpini.base.misc.QueryStringDecoder

public class QueryStringDecoder extends Object
Imported this implementation from netty 3.2.4 because the implementation within 3.5.11 will corrupt uri paths, converting ';' semicolons into '&' ampersands.

Splits an HTTP query string into a path string and key-value parameter pairs. This decoder is for one time use only. Create a new instance for each URI:

 QueryStringDecoder decoder = new QueryStringDecoder("/hello?recipient=world");
 assert decoder.getPath().equals("/hello");
 assert decoder.getParameters().get("recipient").equals("world");
 
See Also:
  • "org.jboss.netty.handler.codec.http.QueryStringEncoder"
  • Constructor Details

    • QueryStringDecoder

      public QueryStringDecoder(String uri)
      Creates a new decoder that decodes the specified URI. The decoder will assume that the query string is encoded in UTF-8.
    • QueryStringDecoder

      public QueryStringDecoder(String uri, Charset charset)
      Creates a new decoder that decodes the specified URI encoded in the specified charset.
    • QueryStringDecoder

      @Deprecated public QueryStringDecoder(String uri, String charset)
      Deprecated.
    • QueryStringDecoder

      public QueryStringDecoder(URI uri)
      Creates a new decoder that decodes the specified URI. The decoder will assume that the query string is encoded in UTF-8.
    • QueryStringDecoder

      public QueryStringDecoder(URI uri, Charset charset)
      Creates a new decoder that decodes the specified URI encoded in the specified charset.
    • QueryStringDecoder

      @Deprecated public QueryStringDecoder(URI uri, String charset)
      Deprecated.
  • Method Details

    • getPath

      public String getPath()
      Returns the decoded path string of the URI.
    • getParameters

      public Map<String,List<String>> getParameters()
      Returns the decoded key-value parameter pairs of the URI.