Examples of retrieveFeed()


Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

       
        // fetch the feed
        log.debug("Fetching feed: "+feedURL);
        SyndFeed feed;
        try {
            feed = feedFetcher.retrieveFeed(new URL(feedURL));
        } catch (Exception ex) {
            throw new FetcherException("Error fetching subscription - "+feedURL, ex);
        }
       
        log.debug("Feed pulled, extracting data into Subscription");
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

            System.err.println("Retrieving feed " + feedUrl);
            // Retrieve the feed.
            // We will get a Feed Polled Event and then a
            // Feed Retrieved event (assuming the feed is valid)
            SyndFeed feed = fetcher.retrieveFeed(feedUrl);

            System.err.println(feedUrl + " retrieved");
            System.err.println(feedUrl + " has a title: " + feed.getTitle() + " and contains "
                    + feed.getEntries().size() + " entries.");
            // We will now retrieve the feed again. If the feed is unmodified
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

                    + feed.getEntries().size() + " entries.");
            // We will now retrieve the feed again. If the feed is unmodified
            // and the server supports conditional gets, we will get a "Feed
            // Unchanged" event after the Feed Polled event
            System.err.println("Polling " + feedUrl + " again to test conditional get support.");
            SyndFeed feed2 = fetcher.retrieveFeed(feedUrl);
            System.err.println("If a \"Feed Unchanged\" event fired then the server supports conditional gets.");

            ok = true;
        } catch (Exception ex) {
            System.out.println("ERROR: " + ex.getMessage());
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

       
        // fetch the feed
        log.debug("Fetching feed: "+feedURL);
        SyndFeed feed;
        try {
            feed = feedFetcher.retrieveFeed(new URL(feedURL));
        } catch (Exception ex) {
            throw new FetcherException("Error fetching subscription - "+feedURL, ex);
        }
       
        log.debug("Feed pulled, extracting data into Subscription");
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

        } catch (IOException e) {
            // another way to load feed RSS
            final FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance();
            final FeedFetcher fetcher = new HttpURLFeedFetcher(feedInfoCache);
            try {
                feed = fetcher.retrieveFeed(new URL(url));
            } catch (Exception e1) {
                logger.error("Error retrieving RSS feed from URL: " + url + ". Cause: " + e1.getMessage(), e1);
            }
        } catch (Exception e) {
            logger.error("Error retrieving RSS feed from URL: " + url + ". Cause: " + e.getMessage(), e);
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

     */
    private static SyndFeed fetch(String url) throws Exception
    {
        FeedFetcher fetcher = new HttpURLFeedFetcher();
        System.out.println("Retrieving: " + url);
        return fetcher.retrieveFeed(new URL(url));
    }
}
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

        // Use Rome Fetcher to get a feed
        URL feedUrl = new URL(args[0]);
        FeedFetcher fetcher = new HttpURLFeedFetcher();
        System.out.println("Retrieving: " + args[0]);
        SyndFeed feed = fetcher.retrieveFeed(feedUrl);

        // For this example we'll use the URL as the UUID.  Check
        // to see if the UUID has already been used for persistence.
        // If not, we'll do an insert with it.  Otherwise, an update.
        String uuid = feedUrl.toString();
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

    FeedFetcherCache feedInfoCache = new HashMapFeedInfoCache();
    FeedFetcher feedFetcher = getFeedFetcher(feedInfoCache);
    FetcherEventListenerImpl listener = new FetcherEventListenerImpl();
    feedFetcher.addFetcherEventListener(listener);
    try {
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:8080/rome/FetcherTestServlet/"));
      assertNotNull(feed);
      assertTrue(listener.polled);
      assertTrue(listener.retrieved);
      assertFalse(listener.unchanged);
      listener.reset();
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

      assertFalse(listener.unchanged);
      listener.reset();
 
      // Since the feed is cached, the second request should not
      // actually retrieve the feed
      feed = feedFetcher.retrieveFeed(new URL("http://localhost:8080/rome/FetcherTestServlet/"));
      assertNotNull(feed);
      assertTrue(listener.polled);
      assertFalse(listener.retrieved);
      assertTrue(listener.unchanged);
      listener.reset();
View Full Code Here

Examples of com.sun.syndication.fetcher.FeedFetcher.retrieveFeed()

      assertFalse(listener.retrieved);
      assertTrue(listener.unchanged);
      listener.reset();
 
      // now simulate getting the feed after it has changed
      feed = feedFetcher.retrieveFeed(new URL("http://localhost:8080/rome/FetcherTestServlet?refreshfeed=TRUE"));
      assertNotNull(feed);
      assertTrue(listener.polled);
      assertTrue(listener.retrieved);
      assertFalse(listener.unchanged);
      listener.reset();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.