use of org.apache.gobblin.source.extractor.exception.RestApiClientException in project incubator-gobblin by apache.
the class SalesforceExtractor method buildUrl.
private static String buildUrl(String path, List<NameValuePair> qparams) throws RestApiClientException {
URIBuilder builder = new URIBuilder();
builder.setPath(path);
ListIterator<NameValuePair> i = qparams.listIterator();
while (i.hasNext()) {
NameValuePair keyValue = i.next();
builder.setParameter(keyValue.getName(), keyValue.getValue());
}
URI uri;
try {
uri = builder.build();
} catch (Exception e) {
throw new RestApiClientException("Failed to build url; error - " + e.getMessage(), e);
}
return new HttpGet(uri).getURI().toString();
}
Aggregations