Package com.google.gdata.util

Examples of com.google.gdata.util.ServiceException


    try {
      startVersionScope();
      request.execute();
      responseStream = request.getResponseStream();
      if (responseStream == null) {
        throw new ServiceException("Unable to obtain service document");
      }

      S serviceDoc = serviceClass.newInstance();
      serviceDoc.parse(extProfile, responseStream);

      return serviceDoc;

    } catch (InstantiationException e) {
      throw new ServiceException("Unable to create service document instance",
          e);
    } catch (IllegalAccessException e) {
      throw new ServiceException("Unable to create service document instance",
          e);
    } finally {
      endVersionScope();
      if (responseStream != null) {
        responseStream.close();
View Full Code Here


      case HttpURLConnection.HTTP_GONE:
        throw new NoLongerAvailableException(httpConn);

      default:
        throw new ServiceException(httpConn);
    }
  }
View Full Code Here

  protected URL handleRedirectException(RedirectRequiredException redirect)
      throws ServiceException {
    try {
      return new URL(redirect.getRedirectLocation());
    } catch (MalformedURLException e) {
      ServiceException se = new ServiceException(
          CoreErrorDomain.ERR.invalidRedirectedToUrl);
      se.setInternalReason("Invalid redirected-to URL - "
          + redirect.getRedirectLocation());
      throw se;
    }
  }
View Full Code Here

   * @return the current state of the feed.
   */
  @SuppressWarnings("unchecked")
  public F getSelf() throws IOException, ServiceException {
    if (feedState.service == null) {
      throw new ServiceException(
         CoreErrorDomain.ERR.feedNotAssociated);
    }
    Link selfLink = getSelfLink();
    if (selfLink == null) {
      throw new UnsupportedOperationException("Feed cannot be retrieved");
View Full Code Here

   *           If there is an error communicating with the GData service.
   */
  public <T extends E> T insert(T newEntry)
      throws ServiceException, IOException {
    if (feedState.service == null) {
      throw new ServiceException(
          CoreErrorDomain.ERR.entryNotAssociated);
    }
    Link postLink = getEntryPostLink();
    if (postLink == null) {
      throw new UnsupportedOperationException("Media cannot be inserted");
View Full Code Here

   *
   * @return the current version of the entry.
   */
  public E getSelf() throws IOException, ServiceException {
    if (state.service == null) {
      throw new ServiceException(
          CoreErrorDomain.ERR.entryNotAssociated);
    }
    Link selfLink = getSelfLink();
    if (selfLink == null) {
      throw new UnsupportedOperationException("Entry cannot be retrieved");
View Full Code Here

   *           If there is an error communicating with the GData service.
   */
  public E update() throws IOException, ServiceException {

    if (state.service == null) {
      throw new ServiceException(
          CoreErrorDomain.ERR.entryNotAssociated);
    }
    Link editLink = getEditLink();
    if (editLink == null) {
      throw new UnsupportedOperationException("Entry cannot be updated");
View Full Code Here

   *           If there is an error communicating with the GData service.
   */
  public void delete() throws IOException, ServiceException {

    if (state.service == null) {
      throw new ServiceException(
          CoreErrorDomain.ERR.entryNotAssociated);
    }
    Link editLink = getEditLink();
    if (editLink == null) {
      throw new UnsupportedOperationException("Entry cannot be deleted");
View Full Code Here

  protected URL handleRedirectException(RedirectRequiredException redirect)
      throws ServiceException {
    try {
      return new URL(redirect.getRedirectLocation());
    } catch (MalformedURLException e) {
      ServiceException se = new ServiceException(
          CoreErrorDomain.ERR.invalidRedirectedToUrl);
      se.setInternalReason("Invalid redirected-to URL - "
          + redirect.getRedirectLocation());
      throw se;
    }
  }
View Full Code Here

    try {
      mediaUrl = new URL(mediaContent.getUri());
      return getMediaResource(mediaUrl,
          mediaContent.getMimeType(), ifModifiedSince);
    } catch (MalformedURLException mue) {
      throw new ServiceException(
          CoreErrorDomain.ERR.invalidMediaSourceUri, mue);
    } catch (RedirectRequiredException e) {
      mediaUrl = handleRedirectException(e);
    } catch (SessionExpiredException e) {
      handleSessionExpiredException(e);
View Full Code Here

TOP

Related Classes of com.google.gdata.util.ServiceException

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.