public class RuntimeHttpUtils extends Object
Constructor and Description |
---|
RuntimeHttpUtils() |
Modifier and Type | Method and Description |
---|---|
static URL |
convertRequestToUrl(Request<?> request,
boolean removeLeadingSlashInResourcePath,
boolean urlEncode)
Converts the specified request object into a URL, containing all the specified parameters, the specified request endpoint,
etc.
|
static InputStream |
fetchFile(URI uri,
ClientConfiguration config)
Fetches a file from the URI given and returns an input stream to it.
|
static String |
getUserAgent(ClientConfiguration config,
String userAgentMarker) |
static URI |
toUri(String endpoint,
ClientConfiguration config)
Returns an URI for the given endpoint.
|
public static InputStream fetchFile(URI uri, ClientConfiguration config) throws IOException
uri
- the uri of the file to fetchconfig
- optional configuration overridesIOException
- on errorpublic static String getUserAgent(ClientConfiguration config, String userAgentMarker)
public static URI toUri(String endpoint, ClientConfiguration config)
IllegalArgumentException
- if the inputs are null.public static URL convertRequestToUrl(Request<?> request, boolean removeLeadingSlashInResourcePath, boolean urlEncode)
request
- The request to convert into a URL.removeLeadingSlashInResourcePath
- Whether the leading slash in resource-path should be removed before appending to
the endpoint.urlEncode
- True if request resource path should be URL encodedSdkClientException
- If the request cannot be converted to a well formed URL.Copyright © 2016. All rights reserved.