org.clapper.curn
Class FeedInfo

java.lang.Object
  extended by org.clapper.curn.FeedInfo

public class FeedInfo
extends java.lang.Object

Contains data for one feed (or site). The data about the feed comes from the configuration file. The feed itself comes from parsing the RSS data.

Version:
$Revision: 6491 $
See Also:
CurnConfig

Field Summary
static java.lang.String DEFAULT_SAVE_AS_ENCODING
          Default encoding for "save as" file.
 
Constructor Summary
FeedInfo(java.net.URL siteURL)
          Default constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Determine whether this FeedInfo object is equivalent to another one, based on the URL.
 int getDaysToCache()
          Get the number of days that URLs from this site are to be cached.
 java.lang.String getForcedCharacterEncoding()
          Get the forced character set encoding for this feed.
 long getMillisecondsToCache()
          Get the number of milliseconds that URLs from this site are to be cached.
 java.net.URL getURL()
          Get the main RSS URL for the site.
 int hashCode()
          Get the hash code for this feed
 void setDaysToCache(int cacheDays)
          Set the "days to cache" value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SAVE_AS_ENCODING

public static final java.lang.String DEFAULT_SAVE_AS_ENCODING
Default encoding for "save as" file.

See Also:
Constant Field Values
Constructor Detail

FeedInfo

public FeedInfo(java.net.URL siteURL)
Default constructor.

Parameters:
siteURL - the main URL for the site's RSS feed. This constructor normalizes the URL.
See Also:
CurnUtil.normalizeURL(java.net.URL)
Method Detail

hashCode

public int hashCode()
Get the hash code for this feed

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code

equals

public boolean equals(java.lang.Object obj)
Determine whether this FeedInfo object is equivalent to another one, based on the URL.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the other object
Returns:
true if obj is a FeedInfo object that specifies the same URL, false otherwise

getURL

public java.net.URL getURL()
Get the main RSS URL for the site.

Returns:
the site's main RSS URL, guaranteed to be normalized
See Also:
CurnUtil.normalizeURL(java.net.URL)

getDaysToCache

public int getDaysToCache()
Get the number of days that URLs from this site are to be cached.

Returns:
the number of days to cache URLs from this site.
See Also:
setDaysToCache(int)

getMillisecondsToCache

public long getMillisecondsToCache()
Get the number of milliseconds that URLs from this site are to be cached. This is a convenience front-end to getDaysToCache().

Returns:
the number of milliseconds to cache URLs from this site
See Also:
getDaysToCache(), setDaysToCache(int)

setDaysToCache

public void setDaysToCache(int cacheDays)
Set the "days to cache" value.

Parameters:
cacheDays - new value
See Also:
getDaysToCache(), getMillisecondsToCache()

getForcedCharacterEncoding

public java.lang.String getForcedCharacterEncoding()
Get the forced character set encoding for this feed. If this parameter is set, curn will ignore the character set encoding advertised by the remote server (if any), and use the character set specified by this configuration item instead. This is useful in the following cases:

Returns:
the forced character set encoding, or null if not configured


Copyright © 2004-2006 Brian M. Clapper. All Rights Reserved.