Package com.sun.syndication.fetcher.impl

Examples of com.sun.syndication.fetcher.impl.HttpURLFeedFetcher


   * @throws FeedException
   * @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


       
        FeedFetcherCache feedCache = getRomeFetcherCache();
       
        FeedFetcher feedFetcher = null;
        if(feedCache != null) {
            feedFetcher = new HttpURLFeedFetcher(feedCache);
        } else {
            feedFetcher = new HttpURLFeedFetcher();
        }
       
        // set options
        feedFetcher.setUsingDeltaEncoding(false);
        feedFetcher.setUserAgent("RollerPlanetAggregator");
View Full Code Here

        }
        /** a hack to set 15 sec timeouts for java.net.HttpURLConnection */
        System.setProperty("sun.net.client.defaultConnectTimeout", "15000");
        System.setProperty("sun.net.client.defaultReadTimeout", "15000");
       
        FeedFetcher feedFetcher = new HttpURLFeedFetcher(feedInfoCache);
        //FeedFetcher feedFetcher = new HttpClientFeedFetcher(feedInfoCache);
        feedFetcher.setUsingDeltaEncoding(false);
        feedFetcher.setUserAgent("RollerPlanetAggregator");
       
        // Loop through all subscriptions in the system
        Iterator subs = getAllSubscriptions();
        while (subs.hasNext()) {
           
View Full Code Here

        try {
            URL feedUrl = new URL("http://www.oksnevad.org/tmp/nyheter.xml");

            FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance();
//            FeedFetcherCache feedInfoCache = new DiskFeedInfoCache("/srv/torrcast_test");
            FeedFetcher fetcher = new HttpURLFeedFetcher(feedInfoCache);

//            FetcherEventListenerImpl listener = new FetcherEventListenerImpl();
            PodcastListener listener = new PodcastListener();
            fetcher.addFetcherEventListener(listener);

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

       
        FeedFetcherCache feedCache = getRomeFetcherCache();
       
        FeedFetcher feedFetcher = null;
        if(feedCache != null) {
            feedFetcher = new HttpURLFeedFetcher(feedCache);
        } else {
            feedFetcher = new HttpURLFeedFetcher();
        }
       
        // set options
        feedFetcher.setUsingDeltaEncoding(false);
        feedFetcher.setUserAgent("RollerPlanetAggregator");
View Full Code Here

        } catch (FeedException e) {
            logger.error("Error retrieving RSS feed from URL: " + url + ". Cause: " + e.getMessage(), e);
        } 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

     * @return
     * @throws Exception
     */
    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

        PrevaylerDAOFactory factory = (PrevaylerDAOFactory) RomeDAOFactory.getDAOFactory(PrevaylerDAOFactory.class);
        PrevaylerSyndFeedDAO syndFeedDAO = (PrevaylerSyndFeedDAO) factory.getSyndFeedDAO();

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

        else //does not require auth
        {
          try
          {
            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

 
  private SyndFeed retrieveFeed(String url) {
    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

TOP

Related Classes of com.sun.syndication.fetcher.impl.HttpURLFeedFetcher

Copyright © 2018 www.massapicom. 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.