* @param url The url to call.
* @return The body of the response.
* @throws OAuthException If an error occurs while making the call.
*/
protected String getServerResponse(String url) throws OAuthException{
OAuthClient oAuthClient = new OAuthClient(new URLConnectionClient());
OAuthClientRequest request;
try {
request = new OAuthBearerClientRequest(url)
.setAccessToken(getAccessToken())
.buildQueryMessage();
} catch (OAuthSystemException e1) {
throw new OAuthException("An error occured while authenticating the user");
}
OAuthResourceResponse response;
try {
response = oAuthClient.resource(request, OAuth.HttpMethod.GET, OAuthResourceResponse.class);
} catch (OAuthProblemException e) {
throw new OAuthException("An error occured while authenticating the user");
} catch (OAuthSystemException e) {
throw new OAuthException("An error occured while authenticating the user");
}