/** * Retrieves the current version of this Entry by requesting it from * the associated GData service. * * @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"); } URL entryUrl = new URL(selfLink.getHref()); try { // If an etag is available, use it to conditionalize the retrieval, // otherwise, use time of last edit or update. if (state.etag != null) { return (E) state.service.getEntry(entryUrl, this.getClass(), state.etag); } else { return (E) state.service.getEntry(entryUrl, this.getClass(), (state.edited != null ? state.edited : state.updated)); } } catch (NotModifiedException e) { return (E) this; } }
/** * Retrieves the current version of this Entry by requesting it from * the associated GData service. * * @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"); } URL entryUrl = new URL(selfLink.getHref()); try { // If an etag is available, use it to conditionalize the retrieval, // otherwise, use time of last edit or update. if (state.etag != null) { return (E) state.service.getEntry(entryUrl, this.getClass(), state.etag); } else { return (E) state.service.getEntry(entryUrl, this.getClass(), (state.edited != null ? state.edited : state.updated)); } } catch (NotModifiedException e) { return (E) this; } }
/** * Retrieves the current version of this Entry by requesting it from * the associated GData service. * * @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"); } URL entryUrl = new URL(selfLink.getHref()); try { // If an etag is available, use it to conditionalize the retrieval, // otherwise, use time of last edit or update. if (state.etag != null) { return (E) state.service.getEntry(entryUrl, this.getClass(), state.etag); } else { return (E) state.service.getEntry(entryUrl, this.getClass(), (state.edited != null ? state.edited : state.updated)); } } catch (NotModifiedException e) { return (E) this; } }