/** * Updates this entry by sending the current representation to the * associated GData service. * * @return the updated entry returned by the Service. * * @throws ServiceException * If there is no associated GData service or the service is * unable to perform the update. * * @throws UnsupportedOperationException * If update is not supported for the target entry. * * @throws IOException * 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"); } URL editUrl = new URL(editLink.getHref()); return (E) state.service.update(editUrl, this); }
/** * Updates this entry by sending the current representation to the * associated GData service. * * @return the updated entry returned by the Service. * * @throws ServiceException * If there is no associated GData service or the service is * unable to perform the update. * * @throws UnsupportedOperationException * If update is not supported for the target entry. * * @throws IOException * 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"); } URL editUrl = new URL(editLink.getHref()); return (E) state.service.update(editUrl, this); }
/** * Updates this entry by sending the current representation to the * associated GData service. * * @return the updated entry returned by the Service. * * @throws ServiceException * If there is no associated GData service or the service is * unable to perform the update. * * @throws UnsupportedOperationException * If update is not supported for the target entry. * * @throws IOException * 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"); } URL editUrl = new URL(editLink.getHref()); return (E) state.service.update(editUrl, this); }
/** * Deletes this entry by sending a request to the associated GData * service. * * @throws ServiceException * If there is no associated GData service or the service is * unable to perform the deletion. * * @throws UnsupportedOperationException * If deletion is not supported for the target entry. * * @throws IOException * 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"); } // Delete the entry, using strong etag (if available) as a precondition. URL editUrl = new URL(editLink.getHref()); state.service.delete(editUrl, GDataProtocol.isWeakEtag(state.etag) ? null : state.etag); }
/** * Deletes this entry by sending a request to the associated GData * service. * * @throws ServiceException * If there is no associated GData service or the service is * unable to perform the deletion. * * @throws UnsupportedOperationException * If deletion is not supported for the target entry. * * @throws IOException * 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"); } // Delete the entry, using strong etag (if available) as a precondition. URL editUrl = new URL(editLink.getHref()); state.service.delete(editUrl, GDataProtocol.isWeakEtag(state.etag) ? null : state.etag); }
/** * Deletes this entry by sending a request to the associated GData * service. * * @throws ServiceException * If there is no associated GData service or the service is * unable to perform the deletion. * * @throws UnsupportedOperationException * If deletion is not supported for the target entry. * * @throws IOException * 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"); } // Delete the entry, using strong etag (if available) as a precondition. URL editUrl = new URL(editLink.getHref()); state.service.delete(editUrl, GDataProtocol.isWeakEtag(state.etag) ? null : state.etag); }