Examples of GDataRequestFactory


Examples of com.google.gdata.client.Service.GDataRequestFactory

          log.info("getAuthorizationHeader(" + requestUrl + ", " + requestMethod + ") = "
              + helper.getAuthorizationHeaderValue());
          return helper.getAuthorizationHeaderValue();
        }
      };
    GDataRequestFactory factory = new GoogleGDataRequest.Factory() {
        @Override protected GDataRequest createRequest(RequestType type, URL requestUrl,
            ContentType contentType) throws IOException, ServiceException {
          return new GoogleGDataRequest(type, requestUrl, contentType, authToken,
              headerMap, privateHeaderMap, connectionSource) {
            // Superclass method barfs with a NullPointerException because it
            // expects a WWW-Authenticate header that isn't there, so override
            // it.
            @Override protected void handleErrorResponse() throws ServiceException, IOException {
              if (httpConn.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {
                throw new SessionExpiredException("Got response code " + httpConn.getResponseCode()
                    + ", token has probably expired");
              }
              super.handleErrorResponse();
            }
          };
        }
      };
    factory.setAuthToken(authToken);
    ContactsService contacts = new ContactsService(clientId,
        factory,
        new AuthTokenFactory() {
          @Override public AuthToken getAuthToken() {
            log.info("getAuthToken()");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.