Package com.google.gdata.client.GoogleService

Examples of com.google.gdata.client.GoogleService.SessionExpiredException


      super.handleErrorResponse();
    } catch (AuthenticationException e) {
      // Throw a more specific exception for session expiration.
      String msg = e.getMessage();
      if (msg != null && msg.contains("Token expired")) {
        SessionExpiredException se =
          new SessionExpiredException(e.getMessage());
        se.setResponse(e.getResponseContentType(), e.getResponseBody());
        throw se;
      }
      throw e;
    }
  }
View Full Code Here


            // 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();
            }
          };
View Full Code Here

      super.handleErrorResponse();
    } catch (AuthenticationException e) {
      // Throw a more specific exception for session expiration.
      String msg = e.getMessage();
      if (msg != null && msg.contains("Token expired")) {
        SessionExpiredException se =
          new SessionExpiredException(e.getMessage());
        se.setResponse(e.getResponseContentType(), e.getResponseBody());
        throw se;
      }
      throw e;
    }
  }
View Full Code Here

    } catch (AuthenticationException e) {
      // Throw a more specific exception for session expiration.
      String msg = e.getMessage();
      if ((msg != null && msg.contains("Token expired")) ||
          (this.authToken != null && this.authToken instanceof OAuth2Token)) {
        SessionExpiredException se =
          new SessionExpiredException(e.getMessage());
        se.setResponse(e.getResponseContentType(), e.getResponseBody());
        throw se;
      }
      throw e;
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gdata.client.GoogleService.SessionExpiredException

Copyright © 2018 www.massapicom. 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.