private Map<String, ConfigEntry> getConfig(String url) throws IOException, UnauthorizedException { HttpResponse response = restClient.execute(HttpMethod.GET, config.resolveURL(url), config.getAccessToken()); List<ConfigEntry> responseObject = ObjectResponse.fromJsonBody(response, new TypeToken<List<ConfigEntry>>() {}) .getResponseObject(); Map<String, ConfigEntry> config = Maps.newHashMap(); for (ConfigEntry configEntry : responseObject) { config.put(configEntry.getName(), configEntry); } return config; }
public Version getVersion() throws IOException, UnauthorizedException { HttpResponse response = restClient.execute(HttpMethod.GET, config.resolveURL("version"), config.getAccessToken()); return ObjectResponse.fromJsonBody(response, Version.class).getResponseObject(); }