Class QueryStringDecoder


  • public class QueryStringDecoder
    extends java.lang.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"
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getParameters()
      Returns the decoded key-value parameter pairs of the URI.
      java.lang.String getPath()
      Returns the decoded path string of the URI.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QueryStringDecoder

        public QueryStringDecoder​(java.lang.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​(java.lang.String uri,
                                  java.nio.charset.Charset charset)
        Creates a new decoder that decodes the specified URI encoded in the specified charset.
      • QueryStringDecoder

        public QueryStringDecoder​(java.net.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​(java.net.URI uri,
                                  java.nio.charset.Charset charset)
        Creates a new decoder that decodes the specified URI encoded in the specified charset.
      • QueryStringDecoder

        @Deprecated
        public QueryStringDecoder​(java.net.URI uri,
                                  java.lang.String charset)
        Deprecated.
    • Method Detail

      • getPath

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

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