/** * Inserts a new Entry into the feed, if the feed is currently * associated with a Service. * * @return the inserted Entry returned by the Service. * * @throws ServiceException * If there is no associated GData service or the service is * unable to perform the insertion. * * @throws UnsupportedOperationException * If insert is not supported for the target feed. * * @throws IOException * 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"); } URL postUrl = new URL(postLink.getHref()); return feedState.service.insert(postUrl, newEntry); }
/** * Inserts a new Entry into the feed, if the feed is currently * associated with a Service. * * @return the inserted Entry returned by the Service. * * @throws ServiceException * If there is no associated GData service or the service is * unable to perform the insertion. * * @throws UnsupportedOperationException * If insert is not supported for the target feed. * * @throws IOException * 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"); } URL postUrl = new URL(postLink.getHref()); return feedState.service.insert(postUrl, newEntry); }
/** * Inserts a new Entry into the feed, if the feed is currently * associated with a Service. * * @return the inserted Entry returned by the Service. * * @throws ServiceException * If there is no associated GData service or the service is * unable to perform the insertion. * * @throws UnsupportedOperationException * If insert is not supported for the target feed. * * @throws IOException * 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"); } URL postUrl = new URL(postLink.getHref()); return feedState.service.insert(postUrl, newEntry); }