/** * Returns the current representation of the feed by requesting it from the * associated service using the feed's self link. * * @return the current state of the feed. */ public Feed 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"); } URL feedUrl = selfLink.getHrefUri().toURL(); try { // Use Etag if available to conditionalize the retrieval, otherwise use // the updated value. String etag = getEtag(); if (etag != null) { return feedState.service.getFeed(feedUrl, this.getClass(), etag); } else { return feedState.service.getFeed( feedUrl, this.getClass(), getUpdated()); } } catch (NotModifiedException e) { return this; } }
/** * Returns the current representation of the feed by requesting it from the * associated service using the feed's self link. * * @return the current state of the feed. */ public Feed 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"); } URL feedUrl = selfLink.getHrefUri().toURL(); try { // Use Etag if available to conditionalize the retrieval, otherwise use // the updated value. String etag = getEtag(); if (etag != null) { return feedState.service.getFeed(feedUrl, this.getClass(), etag); } else { return feedState.service.getFeed( feedUrl, this.getClass(), getUpdated()); } } catch (NotModifiedException e) { return this; } }