Package com.amazonaws.util
Class SdkHttpUtils
java.lang.Object
com.amazonaws.util.SdkHttpUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Append the given path to the given baseUri.static String
Append the given path to the given baseUri.static String
encodeParameters
(SignableRequest<?> request) Creates an encoded query string from all the parameters in the specified request.static boolean
isUsingNonDefaultPort
(URI uri) Returns true if the specified URI is using a non-standard port (i.e. any port other than 80 for HTTP URIs or any port other than 443 for HTTPS URIs).static String
Decode a string for use in the path of a URL; uses URLDecoder.decode, which decodes a string for use in the query portion of a URL.static String
Encode a string for use in the path of a URL; uses URLEncoder.encode, (which encodes a string for use in the query portion of a URL), then applies some postfilters to fix things up per the RFC.static boolean
usePayloadForQueryParameters
(SignableRequest<?> request)
-
Constructor Details
-
SdkHttpUtils
public SdkHttpUtils()
-
-
Method Details
-
urlEncode
Encode a string for use in the path of a URL; uses URLEncoder.encode, (which encodes a string for use in the query portion of a URL), then applies some postfilters to fix things up per the RFC. Can optionally handle strings which are meant to encode a path (ie include '/'es which should NOT be escaped).- Parameters:
value
- the value to encodepath
- true if the value is intended to represent a path- Returns:
- the encoded value
-
urlDecode
Decode a string for use in the path of a URL; uses URLDecoder.decode, which decodes a string for use in the query portion of a URL.- Parameters:
value
- The value to decode- Returns:
- The decoded value if parameter is not null, otherwise, null is returned.
-
isUsingNonDefaultPort
Returns true if the specified URI is using a non-standard port (i.e. any port other than 80 for HTTP URIs or any port other than 443 for HTTPS URIs).- Parameters:
uri
-- Returns:
- True if the specified URI is using a non-standard port, otherwise false.
-
usePayloadForQueryParameters
-
encodeParameters
Creates an encoded query string from all the parameters in the specified request.- Parameters:
request
- The request containing the parameters to encode.- Returns:
- Null if no parameters were present, otherwise the encoded query string for the parameters present in the specified request.
-
appendUri
Append the given path to the given baseUri. By default, all slash characters in path will not be url-encoded. -
appendUri
Append the given path to the given baseUri.- Parameters:
baseUri
- The URI to append to (required, may be relative)path
- The path to append (may be null or empty). Path should be pre-encoded.escapeDoubleSlash
- Whether double-slash in the path should be escaped to "/%2F"- Returns:
- The baseUri with the path appended
-