Class SdkHttpUtils
java.lang.Object
com.amazonaws.util.SdkHttpUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringAppend the given path to the given baseUri.static StringAppend the given path to the given baseUri.static StringencodeParameters(SignableRequest<?> request) Creates an encoded query string from all the parameters in the specified request.static booleanisUsingNonDefaultPort(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 StringDecode 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 StringEncode 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 booleanusePayloadForQueryParameters(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
-
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
-
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
-