Package com.sun.syndication.fetcher.impl

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


        // Check to see if the feed requires authentication
        if (source.getAuthentication() != null) //requires auth
        {
          try
          {
            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;
          }
          catch (Exception e) {
            System.out.println(i + "  " + url);
           
            if (1 == i) { // else just try again
              handleRssError(e, source);
            }
          }
        }
        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

TOP

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

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.