Class Uri


  • public class Uri
    extends Object
    Wrapper around an http URI
    • Constructor Detail

      • Uri

        public Uri()
    • Method Detail

      • appendEncodingUriPath

        public static String appendEncodingUriPath​(String encoded,
                                                   String path)
        Returns a concatanation of an encoded base, and the uri path encoding of a string. This is the modified version of rfc3986 used by sigv4 signing.
        Parameters:
        encoded - The encoded original path.
        path - The path to be encoded and appended to the original path
      • encodeUriPath

        public static String encodeUriPath​(String path)
        Returns the uri path encoding of a string. This is the modified version of rfc3986 used by sigv4 signing.
        Parameters:
        path - The path to be encoded and appended to the original path
      • appendEncodingUriParam

        public static String appendEncodingUriParam​(String encoded,
                                                    String param)
        Returns a concatanation of an encoded base, and the uri query param encoding (passthrough alnum + '-' '_' '~' '.') of a UTF-8 string. For example, reading "a b_c" would write "a%20b_c".
        Parameters:
        encoded - The encoded original param.
        param - The param to be encoded and appended to the original param
      • encodeUriParam

        public static String encodeUriParam​(String param)
        Returns the uri query param encoding (passthrough alnum + '-' '_' '~' '.') of a UTF-8 string. For example, reading "a b_c" would write "a%20b_c".
        Parameters:
        param - The param to be encoded and appended to the original param
      • appendDecodingUri

        public static String appendDecodingUri​(String base,
                                               String encoded)
        Returns a concatanation of a decoded base, and the uri decoding of a UTF-8 string, replacing %xx escapes by their single byte equivalent. For example, reading "a%20b_c" would write "a b_c".
        Parameters:
        base - The decoded base uri.
        encoded - The encoded uri to be decoded and appended to the base uri.
      • decodeUri

        public static String decodeUri​(String encoded)
        Returns the uri decoding of a UTF-8 string, replacing %xx escapes by their single byte equivalent. For example, reading "a%20b_c" would write "a b_c".
        Parameters:
        encoded - The encoded uri to be decoded and appended to the base uri.