Class UrlEncoded

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,​java.util.List<java.lang.String>>

    @Deprecated(since="2021-05-27")
    public class UrlEncoded
    extends MultiMap<java.lang.String>
    implements java.lang.Cloneable
    Deprecated.
    The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
    Handles coding of MIME "x-www-form-urlencoded".

    This class handles the encoding and decoding for either the query string of a URL or the _content of a POST HTTP request.

    Notes

    The UTF-8 charset is assumed, unless otherwise defined by either passing a parameter or setting the "org.eclipse.jetty.util.UrlEncoding.charset" System property.

    The hashtable either contains String single values, vectors of String or arrays of Strings.

    This class is only partially synchronised. In particular, simple get operations are not protected from concurrent updates.

    See Also:
    URLEncoder, Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.nio.charset.Charset ENCODING
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Deprecated.
       
      void decode​(java.lang.String query)
      Deprecated.
       
      void decode​(java.lang.String query, java.nio.charset.Charset charset)
      Deprecated.
       
      static void decode88591To​(java.io.InputStream in, MultiMap<java.lang.String> map, int maxLength, int maxKeys)
      Deprecated.
      Decoded parameters to MultiMap, using ISO8859-1 encodings.
      static java.lang.String decodeString​(java.lang.String encoded)
      Deprecated.
      Decode String with % encoding.
      static java.lang.String decodeString​(java.lang.String encoded, int offset, int length, java.nio.charset.Charset charset)
      Deprecated.
      Decode String with % encoding.
      static void decodeTo​(java.io.InputStream in, MultiMap<java.lang.String> map, java.lang.String charset, int maxLength, int maxKeys)
      Deprecated.
      Decoded parameters to Map.
      static void decodeTo​(java.io.InputStream in, MultiMap<java.lang.String> map, java.nio.charset.Charset charset, int maxLength, int maxKeys)
      Deprecated.
      Decoded parameters to Map.
      static void decodeTo​(java.lang.String content, MultiMap<java.lang.String> map, java.lang.String charset)
      Deprecated.
      Decoded parameters to Map.
      static void decodeTo​(java.lang.String content, MultiMap<java.lang.String> map, java.nio.charset.Charset charset)
      Deprecated.
      Decoded parameters to Map.
      static void decodeUtf16To​(java.io.InputStream in, MultiMap<java.lang.String> map, int maxLength, int maxKeys)
      Deprecated.
       
      static void decodeUtf8To​(java.io.InputStream in, MultiMap<java.lang.String> map, int maxLength, int maxKeys)
      Deprecated.
      Decoded parameters to Map.
      static void decodeUtf8To​(java.lang.String query, int offset, int length, MultiMap<java.lang.String> map)
      Deprecated.
      Decoded parameters to Map.
      static void decodeUtf8To​(java.lang.String query, MultiMap<java.lang.String> map)
      Deprecated.
       
      java.lang.String encode()
      Deprecated.
      Encode MultiMap with % encoding for UTF8 sequences.
      java.lang.String encode​(java.nio.charset.Charset charset)
      Deprecated.
      Encode MultiMap with % encoding for arbitrary Charset sequences.
      java.lang.String encode​(java.nio.charset.Charset charset, boolean equalsForNullValue)
      Deprecated.
      Encode MultiMap with % encoding.
      static java.lang.String encode​(MultiMap<java.lang.String> map, java.nio.charset.Charset charset, boolean equalsForNullValue)
      Deprecated.
      Encode MultiMap with % encoding.
      static java.lang.String encodeString​(java.lang.String string)
      Deprecated.
      Perform URL encoding.
      static java.lang.String encodeString​(java.lang.String string, java.nio.charset.Charset charset)
      Deprecated.
      Perform URL encoding.
      • Methods inherited from class java.util.HashMap

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        equals, hashCode
    • Field Detail

      • ENCODING

        public static final java.nio.charset.Charset ENCODING
        Deprecated.
    • Constructor Detail

      • UrlEncoded

        public UrlEncoded​(UrlEncoded url)
        Deprecated.
      • UrlEncoded

        public UrlEncoded()
        Deprecated.
      • UrlEncoded

        public UrlEncoded​(java.lang.String query)
        Deprecated.
    • Method Detail

      • decode

        public void decode​(java.lang.String query)
        Deprecated.
      • decode

        public void decode​(java.lang.String query,
                           java.nio.charset.Charset charset)
        Deprecated.
      • encode

        public java.lang.String encode()
        Deprecated.
        Encode MultiMap with % encoding for UTF8 sequences.
        Returns:
        the MultiMap as a string with % encoding
      • encode

        public java.lang.String encode​(java.nio.charset.Charset charset)
        Deprecated.
        Encode MultiMap with % encoding for arbitrary Charset sequences.
        Parameters:
        charset - the charset to use for encoding
        Returns:
        the MultiMap as a string encoded with % encodings
      • encode

        public java.lang.String encode​(java.nio.charset.Charset charset,
                                       boolean equalsForNullValue)
        Deprecated.
        Encode MultiMap with % encoding.
        Parameters:
        charset - the charset to encode with
        equalsForNullValue - if True, then an '=' is always used, even for parameters without a value. e.g. "blah?a=&b=&c=".
        Returns:
        the MultiMap as a string encoded with % encodings
      • encode

        public static java.lang.String encode​(MultiMap<java.lang.String> map,
                                              java.nio.charset.Charset charset,
                                              boolean equalsForNullValue)
        Deprecated.
        Encode MultiMap with % encoding.
        Parameters:
        map - the map to encode
        charset - the charset to use for encoding (uses default encoding if null)
        equalsForNullValue - if True, then an '=' is always used, even for parameters without a value. e.g. "blah?a=&b=&c=".
        Returns:
        the MultiMap as a string encoded with % encodings.
      • decodeTo

        public static void decodeTo​(java.lang.String content,
                                    MultiMap<java.lang.String> map,
                                    java.lang.String charset)
        Deprecated.
        Decoded parameters to Map.
        Parameters:
        content - the string containing the encoded parameters
        map - the MultiMap to put parsed query parameters into
        charset - the charset to use for decoding
      • decodeTo

        public static void decodeTo​(java.lang.String content,
                                    MultiMap<java.lang.String> map,
                                    java.nio.charset.Charset charset)
        Deprecated.
        Decoded parameters to Map.
        Parameters:
        content - the string containing the encoded parameters
        map - the MultiMap to put parsed query parameters into
        charset - the charset to use for decoding
      • decodeUtf8To

        public static void decodeUtf8To​(java.lang.String query,
                                        MultiMap<java.lang.String> map)
        Deprecated.
      • decodeUtf8To

        public static void decodeUtf8To​(java.lang.String query,
                                        int offset,
                                        int length,
                                        MultiMap<java.lang.String> map)
        Deprecated.
        Decoded parameters to Map.
        Parameters:
        query - the string containing the encoded parameters
        offset - the offset within raw to decode from
        length - the length of the section to decode
        map - the MultiMap to populate
      • decode88591To

        public static void decode88591To​(java.io.InputStream in,
                                         MultiMap<java.lang.String> map,
                                         int maxLength,
                                         int maxKeys)
                                  throws java.io.IOException
        Deprecated.
        Decoded parameters to MultiMap, using ISO8859-1 encodings.
        Parameters:
        in - InputSteam to read
        map - MultiMap to add parameters to
        maxLength - maximum length of form to read or -1 for no limit
        maxKeys - maximum number of keys to read or -1 for no limit
        Throws:
        java.io.IOException - if unable to decode the InputStream as ISO8859-1
      • decodeUtf8To

        public static void decodeUtf8To​(java.io.InputStream in,
                                        MultiMap<java.lang.String> map,
                                        int maxLength,
                                        int maxKeys)
                                 throws java.io.IOException
        Deprecated.
        Decoded parameters to Map.
        Parameters:
        in - InputSteam to read
        map - MultiMap to add parameters to
        maxLength - maximum form length to decode or -1 for no limit
        maxKeys - the maximum number of keys to read or -1 for no limit
        Throws:
        java.io.IOException - if unable to decode the input stream
      • decodeUtf16To

        public static void decodeUtf16To​(java.io.InputStream in,
                                         MultiMap<java.lang.String> map,
                                         int maxLength,
                                         int maxKeys)
                                  throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • decodeTo

        public static void decodeTo​(java.io.InputStream in,
                                    MultiMap<java.lang.String> map,
                                    java.lang.String charset,
                                    int maxLength,
                                    int maxKeys)
                             throws java.io.IOException
        Deprecated.
        Decoded parameters to Map.
        Parameters:
        in - the stream containing the encoded parameters
        map - the MultiMap to decode into
        charset - the charset to use for decoding
        maxLength - the maximum length of the form to decode or -1 for no limit
        maxKeys - the maximum number of keys to decode or -1 for no limit
        Throws:
        java.io.IOException - if unable to decode the input stream
      • decodeTo

        public static void decodeTo​(java.io.InputStream in,
                                    MultiMap<java.lang.String> map,
                                    java.nio.charset.Charset charset,
                                    int maxLength,
                                    int maxKeys)
                             throws java.io.IOException
        Deprecated.
        Decoded parameters to Map.
        Parameters:
        in - the stream containing the encoded parameters
        map - the MultiMap to decode into
        charset - the charset to use for decoding
        maxLength - the maximum length of the form to decode
        maxKeys - the maximum number of keys to decode
        Throws:
        java.io.IOException - if unable to decode input stream
      • decodeString

        public static java.lang.String decodeString​(java.lang.String encoded)
        Deprecated.
        Decode String with % encoding. This method makes the assumption that the majority of calls will need no decoding.
        Parameters:
        encoded - the encoded string to decode
        Returns:
        the decoded string
      • decodeString

        public static java.lang.String decodeString​(java.lang.String encoded,
                                                    int offset,
                                                    int length,
                                                    java.nio.charset.Charset charset)
        Deprecated.
        Decode String with % encoding. This method makes the assumption that the majority of calls will need no decoding.
        Parameters:
        encoded - the encoded string to decode
        offset - the offset in the encoded string to decode from
        length - the length of characters in the encoded string to decode
        charset - the charset to use for decoding
        Returns:
        the decoded string
      • encodeString

        public static java.lang.String encodeString​(java.lang.String string)
        Deprecated.
        Perform URL encoding.
        Parameters:
        string - the string to encode
        Returns:
        encoded string.
      • encodeString

        public static java.lang.String encodeString​(java.lang.String string,
                                                    java.nio.charset.Charset charset)
        Deprecated.
        Perform URL encoding.
        Parameters:
        string - the string to encode
        charset - the charset to use for encoding
        Returns:
        encoded string.
      • clone

        public java.lang.Object clone()
        Deprecated.
        Overrides:
        clone in class java.util.HashMap<java.lang.String,​java.util.List<java.lang.String>>