use of com.optimizely.ab.config.parser.ConfigParseException in project java-sdk by optimizely.
the class HttpProjectConfigManager method poll.
@Override
protected ProjectConfig poll() {
HttpGet httpGet = createHttpRequest();
CloseableHttpResponse response = null;
logger.debug("Fetching datafile from: {}", httpGet.getURI());
try {
response = httpClient.execute(httpGet);
String datafile = getDatafileFromResponse(response);
if (datafile == null) {
return null;
}
return parseProjectConfig(datafile);
} catch (ConfigParseException | IOException e) {
logger.error("Error fetching datafile", e);
} finally {
if (response != null) {
try {
response.close();
} catch (IOException e) {
logger.warn(e.getLocalizedMessage());
}
}
}
return null;
}
Aggregations