Class Uri


  • public class Uri
    extends java.lang.Object
    Wrapper around an http URI
    • Constructor Summary

      Constructors 
      Constructor Description
      Uri()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String appendDecodingUri​(java.lang.String base, java.lang.String encoded)
      Returns a concatenation of a decoded base, and the URI decoding of a UTF-8 string, replacing %xx escapes by their single byte equivalent.
      static java.lang.String appendEncodingUriParam​(java.lang.String encoded, java.lang.String param)
      Returns a concatenation of an encoded base, and the URI query param encoding (passthrough alnum + '-' '_' '~' '.') of a UTF-8 string.
      static java.lang.String appendEncodingUriPath​(java.lang.String encoded, java.lang.String path)
      Returns a concatenation of an encoded base, and the URI path encoding of a string.
      static java.lang.String decodeUri​(java.lang.String encoded)
      Returns the URI decoding of a UTF-8 string, replacing %xx escapes by their single byte equivalent.
      static java.lang.String encodeUriParam​(java.lang.String param)
      Returns the URI query param encoding (passthrough alnum + '-' '_' '~' '.') of a UTF-8 string.
      static java.lang.String encodeUriPath​(java.lang.String path)
      Returns the URI path encoding of a string.
      • Methods inherited from class java.lang.Object

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

      • Uri

        public Uri()
    • Method Detail

      • appendEncodingUriPath

        public static java.lang.String appendEncodingUriPath​(java.lang.String encoded,
                                                             java.lang.String path)
        Returns a concatenation 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
        Returns:
        concatenation
      • encodeUriPath

        public static java.lang.String encodeUriPath​(java.lang.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
        Returns:
        encoded path
      • appendEncodingUriParam

        public static java.lang.String appendEncodingUriParam​(java.lang.String encoded,
                                                              java.lang.String param)
        Returns a concatenation 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
        Returns:
        concatenation
      • encodeUriParam

        public static java.lang.String encodeUriParam​(java.lang.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
        Returns:
        encoded param
      • appendDecodingUri

        public static java.lang.String appendDecodingUri​(java.lang.String base,
                                                         java.lang.String encoded)
        Returns a concatenation 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.
        Returns:
        concatenation
      • decodeUri

        public static java.lang.String decodeUri​(java.lang.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.
        Returns:
        decoded URI