private void getNextEntries() throws ProponoException { if (nextURI == null) { return; } final GetMethod colGet = new GetMethod(collection.getHrefResolved(nextURI)); collection.addAuthentication(colGet); try { collection.getHttpClient().executeMethod(colGet); final SAXBuilder builder = new SAXBuilder(); final Document doc = builder.build(colGet.getResponseBodyAsStream()); final WireFeedInput feedInput = new WireFeedInput(); col = (Feed) feedInput.build(doc); } catch (final Exception e) { throw new ProponoException("ERROR: fetching or parsing next entries, HTTP code: " + (colGet != null ? colGet.getStatusCode() : -1), e); } finally { colGet.releaseConnection(); } members = col.getEntries().iterator(); col.getEntries().size(); nextURI = null; final List<Link> altLinks = col.getOtherLinks(); if (altLinks != null) { for (final Link link : altLinks) { if ("next".equals(link.getRel())) { nextURI = link.getHref(); } } } }
private InputStream createDefaultFeedDocument(final String uri) throws AtomException { final Feed f = new Feed(); f.setTitle("Feed"); f.setId(uri); f.setFeedType(FEED_TYPE); final Link selfLink = new Link(); selfLink.setRel("self"); selfLink.setHref(uri); f.getOtherLinks().add(selfLink); try { final WireFeedOutput wireFeedOutput = new WireFeedOutput(); final Document feedDoc = wireFeedOutput.outputJDom(f); final XMLOutputter outputter = new XMLOutputter(); // outputter.setFormat(Format.getCompactFormat()); final OutputStream fos = FileStore.getFileStore().getFileOutputStream(getFeedPath()); outputter.output(feedDoc, new OutputStreamWriter(fos, "UTF-8")); } catch (final FeedException ex) { throw new AtomException(ex); } catch (final IOException ex) { throw new AtomException(ex); } catch (final Exception e) { e.printStackTrace(); } return FileStore.getFileStore().getFileInputStream(getFeedPath()); }
syndLinks.addAll(createSyndLinks(alternateLinks)); final List<Link> otherLinks = aFeed.getOtherLinks(); if (Lists.isNotEmpty(otherLinks)) { syndLinks.addAll(createSyndLinks(otherLinks));
syndLinks.addAll(createSyndLinks(alternateLinks)); final List<Link> otherLinks = aFeed.getOtherLinks(); if (Lists.isNotEmpty(otherLinks)) { syndLinks.addAll(createSyndLinks(otherLinks));
final List<Link> otherLinks = aFeed.getOtherLinks(); if (Lists.isNotEmpty(otherLinks)) { syndLinks.addAll(createSyndLinks(otherLinks));
final List<Link> otherLinks = aFeed.getOtherLinks(); if (Lists.isNotEmpty(otherLinks)) { syndLinks.addAll(createSyndLinks(otherLinks));
links = feed.getOtherLinks(); for (final Link link : links) { eFeed.addContent(generateLinkElement(link));
links = feed.getOtherLinks(); for (final Link link : links) { eFeed.addContent(generateLinkElement(link));
final List<Link> otherLinks = feed.getOtherLinks(); if (otherLinks != null) { for (final Link link : otherLinks) {
final List<Link> otherLinks = feed.getOtherLinks(); if (otherLinks != null) { for (final Link link : otherLinks) {