GoogleAuthorizationCodeGrant authRequest = new GoogleAuthorizationCodeGrant(
new UrlFetchTransport(), new JacksonFactory(), clientId, clientSecret, code, callbackUrl);
AccessTokenResponse authResponse;
try {
authResponse = authRequest.execute();
} catch (IOException e) {
log.log(Level.WARNING, "Failed attempt, trying again", e);
if (e instanceof HttpResponseException) {
HttpResponseException f = (HttpResponseException) e;
ByteArrayOutputStream o = new ByteArrayOutputStream();