Package io.outofprintmagazine.nlp.utils
Class HttpUtils
- java.lang.Object
-
- io.outofprintmagazine.nlp.utils.HttpUtils
-
public class HttpUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description HttpUtils()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description URI
buildUri(URI uri, List<org.apache.http.NameValuePair> nvps)
protected org.apache.http.impl.client.CloseableHttpClient
getHttpClient()
static HttpUtils
getInstance(IParameterStore parameterStore)
List<org.apache.http.NameValuePair>
getWikimediaImageInfoParameters()
List<org.apache.http.NameValuePair>
getWikimediaImageParameters()
List<org.apache.http.NameValuePair>
getWikionaryParameters()
URI
getWikipediaApi()
List<org.apache.http.NameValuePair>
getWikipediaCategoriesParameters()
List<org.apache.http.NameValuePair>
getWikipediaExtractsParameters()
List<org.apache.http.NameValuePair>
getWikipediaPagesParameters()
com.fasterxml.jackson.databind.JsonNode
httpGetJson(URI url, List<org.apache.http.Header> headers)
com.fasterxml.jackson.databind.JsonNode
httpGetJson(URI url, org.apache.http.Header[] headers)
void
httpGetJsonCB(URI url, List<org.apache.http.Header> headers, IJsonResponseHandler handler)
void
httpGetJsonCB(URI url, org.apache.http.Header[] headers, IJsonResponseHandler handler)
void
httpGetJsonPaginated(URI baseUri, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.Header> headers, String gimcontinueName, IJsonResponseHandler handler)
String
httpGetString(URI url, List<org.apache.http.Header> headers)
String
httpGetString(URI url, org.apache.http.Header[] headers)
com.fasterxml.jackson.databind.JsonNode
httpPostJson(org.apache.http.client.methods.HttpPost http)
String
httpPostString(org.apache.http.client.methods.HttpPost http)
-
-
-
Method Detail
-
getInstance
public static HttpUtils getInstance(IParameterStore parameterStore) throws IOException
- Throws:
IOException
-
getHttpClient
protected org.apache.http.impl.client.CloseableHttpClient getHttpClient()
-
buildUri
public URI buildUri(URI uri, List<org.apache.http.NameValuePair> nvps) throws URISyntaxException
- Throws:
URISyntaxException
-
httpGetJson
public com.fasterxml.jackson.databind.JsonNode httpGetJson(URI url, List<org.apache.http.Header> headers) throws IOException
- Throws:
IOException
-
httpGetJson
public com.fasterxml.jackson.databind.JsonNode httpGetJson(URI url, org.apache.http.Header[] headers) throws IOException
- Throws:
IOException
-
httpGetJsonCB
public void httpGetJsonCB(URI url, List<org.apache.http.Header> headers, IJsonResponseHandler handler) throws IOException
- Throws:
IOException
-
httpGetJsonCB
public void httpGetJsonCB(URI url, org.apache.http.Header[] headers, IJsonResponseHandler handler) throws IOException
- Throws:
IOException
-
httpGetString
public String httpGetString(URI url, List<org.apache.http.Header> headers) throws IOException
- Throws:
IOException
-
httpGetString
public String httpGetString(URI url, org.apache.http.Header[] headers) throws IOException
- Throws:
IOException
-
httpPostJson
public com.fasterxml.jackson.databind.JsonNode httpPostJson(org.apache.http.client.methods.HttpPost http) throws IOException
- Throws:
IOException
-
httpPostString
public String httpPostString(org.apache.http.client.methods.HttpPost http) throws IOException
- Throws:
IOException
-
getWikipediaApi
public URI getWikipediaApi() throws URISyntaxException
- Throws:
URISyntaxException
-
getWikimediaImageParameters
public List<org.apache.http.NameValuePair> getWikimediaImageParameters()
-
getWikimediaImageInfoParameters
public List<org.apache.http.NameValuePair> getWikimediaImageInfoParameters()
-
getWikionaryParameters
public List<org.apache.http.NameValuePair> getWikionaryParameters()
-
getWikipediaCategoriesParameters
public List<org.apache.http.NameValuePair> getWikipediaCategoriesParameters()
-
getWikipediaPagesParameters
public List<org.apache.http.NameValuePair> getWikipediaPagesParameters()
-
getWikipediaExtractsParameters
public List<org.apache.http.NameValuePair> getWikipediaExtractsParameters()
-
httpGetJsonPaginated
public void httpGetJsonPaginated(URI baseUri, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.Header> headers, String gimcontinueName, IJsonResponseHandler handler) throws IOException, URISyntaxException
- Throws:
IOException
URISyntaxException
-
-