Package com.sun.syndication.fetcher.impl

Examples of com.sun.syndication.fetcher.impl.HttpURLFeedFetcher.retrieveFeed()


   * @throws FetcherException
   */
  public SyndFeed retrieveFeed(String sUrl)
    throws FeedException,FetcherException,IOException {
    HttpURLFeedFetcher oFtchr = new HttpURLFeedFetcher(oDche);
    return oFtchr.retrieveFeed(new URL(sUrl));
  }
}
View Full Code Here


            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

                    + 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

        } 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

     */
    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

        // 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

            FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance();
            FeedFetcher feedFetcher = new HttpURLFeedFetcher(feedInfoCache);
            if ((null != source.getRssConfig()) && (null != source.getRssConfig().getUserAgent())) {
              feedFetcher.setUserAgent(source.getRssConfig().getUserAgent());
            }
            SyndFeed retVal = feedFetcher.retrieveFeed(new URL(this.cleanUrlStart(url)));
            if (null == retVal) {
              handleRssError(new RuntimeException("Unknown RSS error") , source);             
            }
            return retVal;
          }
View Full Code Here

    SyndFeed inFeed = null;
    try {
      FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance();
      FeedFetcher feedFetcher = new HttpURLFeedFetcher(feedInfoCache);
      URL inputUrl = new URL(url);
      inFeed = feedFetcher.retrieveFeed(inputUrl);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "error in retrieveFeed with url: " + url);
    }
    return inFeed;
  }
View Full Code Here

        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
        // and the server supports conditional gets, we will get a "Feed
View Full Code Here

        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
        // 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) {
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.