Examples of retrieveFeed()


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

          {
            FeedFetcher feedFetcher = new HttpClientFeedFetcher(null, authenticateFeed(source.getAuthentication()));
            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

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

            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

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

    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

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

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

        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

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

        FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance();
        FeedFetcher feedFetcher = new HttpURLFeedFetcher(feedInfoCache);

                for (int i=1;i<args.length;i++) {
                    URL inputUrl = new URL(args[i]);
          SyndFeed inFeed = feedFetcher.retrieveFeed(inputUrl);
                    entries.addAll(inFeed.getEntries());
                }

                SyndFeedOutput output = new SyndFeedOutput();
        output.output(feed, new PrintWriter(System.out));
View Full Code Here

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

  }

  public void testRetrieveFeed() {
    FeedFetcher feedFetcher = getFeedFetcher();
    try {
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:"+testPort+"/rome/FetcherTestServlet/"));
      assertNotNull(feed);
      assertEquals("atom_0.3.feed.title", feed.getTitle());
    } catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
View Full Code Here

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

            server.addContext(context);   
           
            server.start();           
           
            FeedFetcher feedFetcher = getAuthenticatedFeedFetcher();
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:"+testPort+"/rome/FetcherTestServlet/"));
      assertNotNull(feed);
      assertEquals("atom_0.3.feed.title", feed.getTitle());
           
           
        } catch (Exception e) {
View Full Code Here

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

   *
   */
  public void testRetrieveRedirectedFeed() {
    FeedFetcher feedFetcher = getFeedFetcher();
    try {     
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:"+testPort+"/rome/FetcherTestServlet?redirect=TRUE"));
      assertNotNull(feed);
      assertEquals("atom_0.3.feed.title", feed.getTitle());
    } catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
View Full Code Here

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

   *
   */
  public void testErrorHandling() {
    FeedFetcher feedFetcher = getFeedFetcher();
    try {
      SyndFeed feed = feedFetcher.retrieveFeed(new URL("http://localhost:"+testPort+"/rome/FetcherTestServlet?error=404"));
      fail("4xx error handling did not work correctly");
    } catch (FetcherException e) {
      // expect this exception
      assertEquals(404, e.getResponseCode());
    } catch (Exception e) {
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.