Package com.rometools.fetcher.impl
Class HttpURLFeedFetcher
- java.lang.Object
-
- com.rometools.fetcher.impl.AbstractFeedFetcher
-
- com.rometools.fetcher.impl.HttpURLFeedFetcher
-
- All Implemented Interfaces:
FeedFetcher
@Deprecated public class HttpURLFeedFetcher extends AbstractFeedFetcher
Deprecated.ROME Fetcher will be dropped in the next major version of ROME (version 2). For more information and some migration hints, please have a look at our detailed explanation.Class to retrieve syndication files via HTTP.
If passed a
FeedFetcherCachein the constructor it will use conditional gets to only retrieve modified content.The class uses the Accept-Encoding: gzip header to retrieve gzipped feeds where supported by the server.
Simple usage:
// create the cache FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getFeedInfoCache(); // retrieve the feed the first time // any subsequent request will use conditional gets and only // retrieve the resource if it has changed SyndFeed feed = new HttpURLFeedFetcher(feedInfoCache).retrieveFeed(feedUrl);
-
-
Field Summary
-
Fields inherited from interface com.rometools.fetcher.FeedFetcher
DEFAULT_USER_AGENT
-
-
Constructor Summary
Constructors Constructor Description HttpURLFeedFetcher()Deprecated.Constructor to use HttpURLFeedFetcher without caching of feedsHttpURLFeedFetcher(FeedFetcherCache feedInfoCache)Deprecated.Constructor to enable HttpURLFeedFetcher to cache feeds
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FeedFetcherCachegetFeedInfoCache()Deprecated.protected voidresetFeedInfo(URL orignalUrl, SyndFeedInfo syndFeedInfo, HttpURLConnection connection)Deprecated.protected voidretrieveAndCacheFeed(URL feedUrl, SyndFeedInfo syndFeedInfo, HttpURLConnection connection)Deprecated.SyndFeedretrieveFeed(String userAgent, URL feedUrl)Deprecated.Retrieve a feed over HTTPSyndFeedretrieveFeed(URL feedUrl)Deprecated.Retrieve a feed over HTTPvoidsetConnectTimeout(int timeout)Deprecated.voidsetFeedInfoCache(FeedFetcherCache cache)Deprecated.protected voidsetRequestHeaders(URLConnection connection, SyndFeedInfo syndFeedInfo, String userAgent)Deprecated.Set appropriate HTTP headers, including conditional get and gzip encoding headers-
Methods inherited from class com.rometools.fetcher.impl.AbstractFeedFetcher
addFetcherEventListener, combineFeeds, fireEvent, fireEvent, fireEvent, fireEvent, getUserAgent, handleErrorCodes, isAllowDoctypes, isPreserveWireFeed, isUsingDeltaEncoding, removeFetcherEventListener, setAllowDoctypes, setPreserveWireFeed, setUserAgent, setUsingDeltaEncoding, throw4XXError, throwAuthenticationError
-
-
-
-
Constructor Detail
-
HttpURLFeedFetcher
public HttpURLFeedFetcher()
Deprecated.Constructor to use HttpURLFeedFetcher without caching of feeds
-
HttpURLFeedFetcher
public HttpURLFeedFetcher(FeedFetcherCache feedInfoCache)
Deprecated.Constructor to enable HttpURLFeedFetcher to cache feeds- Parameters:
feedInfoCache- - an instance of the FeedFetcherCache interface
-
-
Method Detail
-
retrieveFeed
public SyndFeed retrieveFeed(URL feedUrl) throws IllegalArgumentException, IOException, FeedException, FetcherException
Deprecated.Description copied from interface:FeedFetcherRetrieve a feed over HTTP- Parameters:
feedUrl- A non-null URL of a RSS/Atom feed to retrieve- Returns:
- A
SyndFeedobject - Throws:
IllegalArgumentException- if the URL is null;IOException- if a TCP error occursFeedException- if the feed is not validFetcherException- if a HTTP error occurred
-
retrieveFeed
public SyndFeed retrieveFeed(String userAgent, URL feedUrl) throws IllegalArgumentException, IOException, FeedException, FetcherException
Deprecated.Retrieve a feed over HTTP- Parameters:
feedUrl- A non-null URL of a RSS/Atom feed to retrieve- Returns:
- A
SyndFeedobject - Throws:
IllegalArgumentException- if the URL is null;IOException- if a TCP error occursFeedException- if the feed is not validFetcherException- if a HTTP error occurred
-
retrieveAndCacheFeed
protected void retrieveAndCacheFeed(URL feedUrl, SyndFeedInfo syndFeedInfo, HttpURLConnection connection) throws IllegalArgumentException, FeedException, FetcherException, IOException
Deprecated.
-
resetFeedInfo
protected void resetFeedInfo(URL orignalUrl, SyndFeedInfo syndFeedInfo, HttpURLConnection connection) throws IllegalArgumentException, IOException, FeedException
Deprecated.
-
setRequestHeaders
protected void setRequestHeaders(URLConnection connection, SyndFeedInfo syndFeedInfo, String userAgent)
Deprecated.Set appropriate HTTP headers, including conditional get and gzip encoding headers
- Parameters:
connection- A URLConnectionsyndFeedInfo- The SyndFeedInfo for the feed to be retrieved. May be nulluserAgent- the name of the user-agent to be placed in HTTP-header.
-
getFeedInfoCache
public FeedFetcherCache getFeedInfoCache()
Deprecated.- Returns:
- The FeedFetcherCache used by this fetcher (Could be null)
-
setFeedInfoCache
public void setFeedInfoCache(FeedFetcherCache cache)
Deprecated.- Parameters:
cache- The cache to be used by this fetcher (pass null to stop using a cache)
-
setConnectTimeout
public void setConnectTimeout(int timeout)
Deprecated.- Parameters:
timeout- see java.net.URLConnection.setConnectTimeout(int timeout)
-
-