response.ignore(); } catch (HttpResponseException e) {
/** * Sends the metadata request using HEAD to the server and returns the raw metadata * {@link HttpResponse} for the response headers. * * <p> * Only supported when the original request method is GET. The response content is assumed to be * empty and ignored. Calls {@link HttpResponse#ignore()} so there is no need to disconnect the * response. Example usage: * </p> * * <pre> HttpResponse response = request.executeUsingHead(); // look at response.getHeaders() * </pre> * * <p> * Subclasses may override by calling the super implementation. * </p> * * @return the {@link HttpResponse} */ protected HttpResponse executeUsingHead() throws IOException { Preconditions.checkArgument(uploader == null); HttpResponse response = executeUnparsed(true); response.ignore(); return response; }
@Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { PersistenceManager pm = getPersistenceManagerFactory().getPersistenceManager(); req.setAttribute(AUTH_PERSISTENCE_MANAGER, pm); try { // Invoke the user code super.service(req, resp); } catch (HttpResponseException e) { // After this catch block, control flow would be returned to the servlet container, therefore // Google APIs client requests will have their content consumed here to make it available for // logging. e.getResponse().ignore(); throw e; } finally { pm.close(); } }
System.out.println(httpResponse.parseAsString()); } finally { httpResponse.ignore();
/** * Revokes the long-lived access token. * * @param parameters OAuth parameters * @throws IOException I/O exception * @since 1.3 */ public static void revokeAccessToken(HttpTransport transport, OAuthParameters parameters) throws IOException { HttpRequest request = transport.createRequestFactory().buildGetRequest( new GenericUrl("https://www.google.com/accounts/AuthSubRevokeToken")); parameters.intercept(request); request.execute().ignore(); } }
/** * Revokes the session token. Clears any existing authorization header of the Google transport and * automatically resets the token by calling {@code setToken(null)}. * <p> * See <a href= "http://code.google.com/apis/accounts/docs/AuthSub.html#AuthSubRevokeToken" * >AuthSubRevokeToken</a> for protocol details. * * @throws HttpResponseException if the authentication response has an error code * @throws IOException some other kind of I/O exception */ public void revokeSessionToken() throws IOException { HttpTransport authSubTransport = this.authSubTransport; HttpRequest request = authSubTransport.createRequestFactory().buildGetRequest( new GenericUrl("https://www.google.com/accounts/AuthSubRevokeToken")); request.execute().ignore(); setToken(null); }
e.getResponse().ignore();
} finally { if (parser == null) { response.ignore(); } else if (details == null) { parser.close();