public class Util extends Object
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static String |
assembleURL(String base,
String... parameters)
Add a query string to a URL.
|
static InputStream |
dumpInputStream(InputStream in) |
static String[] |
flattenMap(Map<String,String> map)
Turn a Map<String, String> to an array of Strings.
|
static int |
getIntFromHeader(org.apache.http.client.methods.CloseableHttpResponse response,
String headerName) |
public static String assembleURL(String base, String... parameters) throws UnsupportedEncodingException
base
- String Base url. Should be well formed, but that isn't
checked (and doesn't make any difference to the method)parameters
- String... list of key/value pairs.IllegalArgumentException
- if the parameters don't come in pairsUnsupportedEncodingException
- if Java doesn't know UTF-8public static String[] flattenMap(Map<String,String> map)
map
- Map<String, String> to convertpublic static int getIntFromHeader(org.apache.http.client.methods.CloseableHttpResponse response, String headerName)
public static InputStream dumpInputStream(InputStream in) throws IOException
IOException
Copyright © 2015. All rights reserved.