From 9b5acb1585ee48c81f4c7914092eeabcba1ddcc1 Mon Sep 17 00:00:00 2001 From: kebernet Date: Tue, 1 Mar 2011 19:59:36 +0000 Subject: [PATCH] light cleanup --- pom.xml | 3 + .../sun/syndication/fetcher/FeedFetcher.java | 106 +++++++++--------- 2 files changed, 57 insertions(+), 52 deletions(-) diff --git a/pom.xml b/pom.xml index d9674af..a5d5782 100644 --- a/pom.xml +++ b/pom.xml @@ -129,18 +129,21 @@ commons-httpclient commons-httpclient 3.0.1 + commons-logging commons-logging 1.0.4 + commons-logging commons-logging-api 1.0.4 + diff --git a/src/java/com/sun/syndication/fetcher/FeedFetcher.java b/src/java/com/sun/syndication/fetcher/FeedFetcher.java index b8a5026..2bd4a10 100644 --- a/src/java/com/sun/syndication/fetcher/FeedFetcher.java +++ b/src/java/com/sun/syndication/fetcher/FeedFetcher.java @@ -23,59 +23,62 @@ import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.io.FeedException; public interface FeedFetcher { - /** - *

The default user agent. It is not marked final so - * buggy java compiler will not write this string - * into all classes that reference it.

- * - *

http://tinyurl.com/64t5n points to https://rome.dev.java.net/ - * Some servers ban user agents with "Java" in the name.

- * - */ - public static String DEFAULT_USER_AGENT = "Rome Client (http://tinyurl.com/64t5n)"; - /** - * @return the User-Agent currently being sent to servers - */ - public abstract String getUserAgent(); - /** - * @param string The User-Agent to sent to servers - */ - public abstract void setUserAgent(String string); - /** - * Retrieve a feed over HTTP - * - * @param feedUrl A non-null URL of a RSS/Atom feed to retrieve - * @return A {@link com.sun.syndication.feed.synd.SyndFeed} object - * @throws IllegalArgumentException if the URL is null; - * @throws IOException if a TCP error occurs - * @throws FeedException if the feed is not valid - * @throws FetcherException if a HTTP error occurred - */ - public abstract SyndFeed retrieveFeed(URL feedUrl) throws IllegalArgumentException, IOException, FeedException, FetcherException; + /** + *

The default user agent. It is not marked final so + * buggy java compiler will not write this string + * into all classes that reference it.

+ * + *

http://tinyurl.com/64t5n points to https://rome.dev.java.net/ + * Some servers ban user agents with "Java" in the name.

+ * + */ + public static String DEFAULT_USER_AGENT = "Rome Client (http://tinyurl.com/64t5n)"; - /** - *

Add a FetcherListener.

- * - *

The FetcherListener will receive an FetcherEvent when - * a Fetcher event (feed polled, retrieved, etc) occurs

- * - * @param listener The FetcherListener to recieve the event - */ - public abstract void addFetcherEventListener(FetcherListener listener); + /** + * @return the User-Agent currently being sent to servers + */ + public abstract String getUserAgent(); - /** - *

Remove a FetcherListener

- * - * @param listener The FetcherListener to remove - */ - public abstract void removeFetcherEventListener(FetcherListener listener); + /** + * @param string The User-Agent to sent to servers + */ + public abstract void setUserAgent(String string); - /** - *

Is this fetcher using rfc3229 delta encoding?

- * - * @return - */ + /** + * Retrieve a feed over HTTP + * + * @param feedUrl A non-null URL of a RSS/Atom feed to retrieve + * @return A {@link com.sun.syndication.feed.synd.SyndFeed} object + * @throws IllegalArgumentException if the URL is null; + * @throws IOException if a TCP error occurs + * @throws FeedException if the feed is not valid + * @throws FetcherException if a HTTP error occurred + */ + public abstract SyndFeed retrieveFeed(URL feedUrl) throws IllegalArgumentException, IOException, FeedException, FetcherException; + + /** + *

Add a FetcherListener.

+ * + *

The FetcherListener will receive an FetcherEvent when + * a Fetcher event (feed polled, retrieved, etc) occurs

+ * + * @param listener The FetcherListener to recieve the event + */ + public abstract void addFetcherEventListener(FetcherListener listener); + + /** + *

Remove a FetcherListener

+ * + * @param listener The FetcherListener to remove + */ + public abstract void removeFetcherEventListener(FetcherListener listener); + + /** + *

Is this fetcher using rfc3229 delta encoding?

+ * + * @return + */ public abstract boolean isUsingDeltaEncoding(); /** @@ -88,11 +91,10 @@ public interface FeedFetcher { * @param useDeltaEncoding */ public abstract void setUsingDeltaEncoding(boolean useDeltaEncoding); - + /** * If set to true, the WireFeed will be made accessible from the SyndFeed object returned from the Fetcher * via the originalWireFeed() method. Each Entry in the feed will have the corresponding wireEntry property set. */ void setPreserveWireFeed(boolean preserveWireFeed); - -} \ No newline at end of file +}