Class HTTPCall
- java.lang.Object
-
- org.gcube.documentstore.persistence.HTTPCall
-
public class HTTPCall extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHTTPCall.HTTPMETHOD
-
Field Summary
Fields Modifier and Type Field Description protected Stringaddressstatic StringAPPLICATION_JSON_CHARSET_UTF_8static StringPARAM_EQUALSstatic StringPARAM_SEPARATORstatic StringPARAM_STARTERstatic StringPATH_SEPARATORprotected StringuserAgentstatic StringUTF8
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <C> Ccall(Class<C> clz, String path, HTTPCall.HTTPMETHOD method)<C> Ccall(Class<C> clz, String path, HTTPCall.HTTPMETHOD method, String body)<C> Ccall(Class<C> clz, String path, HTTPCall.HTTPMETHOD method, Map<String,? extends Object> parameters)protected <C> Ccall(Class<C> clz, String path, HTTPCall.HTTPMETHOD method, Map<String,? extends Object> parameters, String body)protected HttpURLConnectiongetConnection(String path, String urlParameters, HTTPCall.HTTPMETHOD method, String body)protected HttpURLConnectiongetConnection(URL url, HTTPCall.HTTPMETHOD method, String body)protected StringgetParametersDataString(Map<String,? extends Object> parameters)protected StringBuildergetStringBuilder(InputStream inputStream)protected URLgetURL(String urlString)protected URLgetURL(String address, String path, String urlParameters)
-
-
-
Field Detail
-
APPLICATION_JSON_CHARSET_UTF_8
public static final String APPLICATION_JSON_CHARSET_UTF_8
- See Also:
- Constant Field Values
-
PATH_SEPARATOR
public static final String PATH_SEPARATOR
- See Also:
- Constant Field Values
-
PARAM_STARTER
public static final String PARAM_STARTER
- See Also:
- Constant Field Values
-
PARAM_EQUALS
public static final String PARAM_EQUALS
- See Also:
- Constant Field Values
-
PARAM_SEPARATOR
public static final String PARAM_SEPARATOR
- See Also:
- Constant Field Values
-
UTF8
public static final String UTF8
- See Also:
- Constant Field Values
-
address
protected final String address
-
userAgent
protected final String userAgent
-
-
Method Detail
-
getParametersDataString
protected String getParametersDataString(Map<String,? extends Object> parameters) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
getURL
protected URL getURL(String address, String path, String urlParameters) throws MalformedURLException
- Throws:
MalformedURLException
-
getURL
protected URL getURL(String urlString) throws MalformedURLException
- Throws:
MalformedURLException
-
getConnection
protected HttpURLConnection getConnection(String path, String urlParameters, HTTPCall.HTTPMETHOD method, String body) throws Exception
- Throws:
Exception
-
getConnection
protected HttpURLConnection getConnection(URL url, HTTPCall.HTTPMETHOD method, String body) throws Exception
- Throws:
Exception
-
getStringBuilder
protected StringBuilder getStringBuilder(InputStream inputStream) throws IOException
- Throws:
IOException
-
call
public <C> C call(Class<C> clz, String path, HTTPCall.HTTPMETHOD method) throws Exception
- Throws:
Exception
-
call
public <C> C call(Class<C> clz, String path, HTTPCall.HTTPMETHOD method, Map<String,? extends Object> parameters) throws Exception
- Throws:
Exception
-
call
public <C> C call(Class<C> clz, String path, HTTPCall.HTTPMETHOD method, String body) throws Exception
- Throws:
Exception
-
-