buttress.rss
Class Rss

java.lang.Object
  extended bybuttress.rss.Rss

public class Rss
extends java.lang.Object


Constructor Summary
Rss()
          Default contructor sets all values to null
Rss(Rss other)
          Creates a Rss object repesenting the same values as another Rss object
Rss(java.lang.String f)
          Contructor for feed location
Rss(java.lang.String t, java.lang.String f)
          Constructor for title link and feed url
Rss(java.lang.String t, java.lang.String f, java.lang.String b, java.lang.String bu)
          Constructor for title link and feed url
 
Method Summary
 boolean addItem(java.lang.Object rssItem)
          Add an item to the list object or rss item
 void clearItems()
          Clear all items from list
 boolean containsItem(java.lang.Object rssItem)
          Returns true if item is already in the list
static boolean downloadIt(RssItem item, boolean autoStart)
          downloads a new torrent if possible.
 void flushRssItems()
          Flushes the list of Rss items
 java.lang.String getBtPath()
          gets bittorrent client path
 java.lang.String getButFolder()
          gets buttress folder path
 int getFeedSize()
          used to access the private arraylist
 java.net.URL getFeedUrl()
          Returns feedUrl component of the Rss object
 java.util.List getFilterList()
           
 boolean getItemStatus(int pos)
          Returns an item's status Integer indicates which item in the list
 RssItem getRssItem(int i)
          Gets Rss Item at position i
 java.lang.String getTitle()
           
static boolean isGoodFeed(java.lang.String f)
           
 java.util.List listAllItems()
          returns a list of all of the items that are on the rss lists
 java.util.List listAllItems(java.util.List items)
          returns a list of all of the items that are on the rss lists and adds new ones to the list that is passed
 void set(Rss other)
          Sets the Rss object to the values of the other specified Rss object
 void setBtPath(java.lang.String p)
          sets bittorrent client path
 void setButFolder(java.lang.String f)
          sets buttress folder path
 void setFeedUrl(java.lang.String f)
          Sets feed url component of the Rss object
 void setFilterList(java.util.List filterList)
           
 void setNew(int i, boolean isNew)
          Changes the specified item's new status
 void setTitle(java.lang.String t)
          Sets title component of the Rss object
 java.lang.String testToString(int i)
          returns a string for a rssitem held in the arraylist
 java.lang.String toString()
          Returns a sensible string of the Rss object
 java.util.List updateFeed(java.util.List filters)
          updates the feed from the feedurl, and add the new items to the arraylist
static java.lang.String userCheckUrl(Rss feed, java.lang.String problemName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rss

public Rss()
Default contructor sets all values to null


Rss

public Rss(java.lang.String f)
Contructor for feed location

Parameters:
f - url of feed of Rss

Rss

public Rss(java.lang.String t,
           java.lang.String f)
Constructor for title link and feed url

Parameters:
t - title string
f - feed url

Rss

public Rss(java.lang.String t,
           java.lang.String f,
           java.lang.String b,
           java.lang.String bu)
Constructor for title link and feed url

Parameters:
t - title string
f - feed url
b - bittorrent client path
bu - buttress folder

Rss

public Rss(Rss other)
Creates a Rss object repesenting the same values as another Rss object

Parameters:
other - other Rss object
Method Detail

set

public final void set(Rss other)
Sets the Rss object to the values of the other specified Rss object

Parameters:
other - other Rss object

getTitle

public java.lang.String getTitle()
Returns:
title component of the Rss object

getFeedUrl

public java.net.URL getFeedUrl()
Returns feedUrl component of the Rss object

Returns:
reedUrl

getBtPath

public java.lang.String getBtPath()
gets bittorrent client path

Returns:
btPath

getButFolder

public java.lang.String getButFolder()
gets buttress folder path

Returns:
butFolder

getItemStatus

public boolean getItemStatus(int pos)
Returns an item's status Integer indicates which item in the list

Parameters:
pos - int
Returns:
itemstatus

getFilterList

public java.util.List getFilterList()
Returns:
Returns the filterList all items in this feed are tested against

setFilterList

public void setFilterList(java.util.List filterList)
Parameters:
filterList - the new list of filters to test against

setTitle

public void setTitle(java.lang.String t)
Sets title component of the Rss object

Parameters:
t - String

setBtPath

public void setBtPath(java.lang.String p)
sets bittorrent client path

Parameters:
p - path

setButFolder

public void setButFolder(java.lang.String f)
sets buttress folder path

Parameters:
f - folder

setFeedUrl

public void setFeedUrl(java.lang.String f)
Sets feed url component of the Rss object

Parameters:
f - String

setNew

public void setNew(int i,
                   boolean isNew)
Changes the specified item's new status

Parameters:
i - Feed item to change
isNew - true = item is new, false = item is old

toString

public java.lang.String toString()
Returns a sensible string of the Rss object

Returns:
string

testToString

public java.lang.String testToString(int i)
returns a string for a rssitem held in the arraylist

Parameters:
i - int
Returns:
string of rssitem

addItem

public boolean addItem(java.lang.Object rssItem)
Add an item to the list object or rss item

Parameters:
rssItem - item object
Returns:
true if item is added

clearItems

public void clearItems()
Clear all items from list


getFeedSize

public int getFeedSize()
used to access the private arraylist

Returns:
int of array size

containsItem

public boolean containsItem(java.lang.Object rssItem)
Returns true if item is already in the list

Parameters:
rssItem - Object
Returns:
true if item is already in the list

flushRssItems

public void flushRssItems()
Flushes the list of Rss items


getRssItem

public RssItem getRssItem(int i)
Gets Rss Item at position i

Parameters:
i - int
Returns:
RssItem

updateFeed

public java.util.List updateFeed(java.util.List filters)
                          throws java.lang.Exception
updates the feed from the feedurl, and add the new items to the arraylist

adds items only if the item is of interest (in the filter list)

sets description of items returned to the filters they matched.

Parameters:
filters - List
Throws:
java.lang.Exception

listAllItems

public java.util.List listAllItems()
                            throws java.lang.Exception
returns a list of all of the items that are on the rss lists

Returns:
the list of items
Throws:
java.lang.Exception

listAllItems

public java.util.List listAllItems(java.util.List items)
                            throws java.lang.Exception
returns a list of all of the items that are on the rss lists and adds new ones to the list that is passed

Parameters:
items - List
Returns:
the list of items
Throws:
java.lang.Exception

downloadIt

public static boolean downloadIt(RssItem item,
                                 boolean autoStart)
downloads a new torrent if possible. sets the torrent to old to avoid downloading in the future.

Parameters:
item - the RssItem to download
autoStart - boolean
Returns:
whether or not it started the torrent

isGoodFeed

public static boolean isGoodFeed(java.lang.String f)
Parameters:
f - String
Returns:
boolean

userCheckUrl

public static java.lang.String userCheckUrl(Rss feed,
                                            java.lang.String problemName)
Parameters:
feed - Rss the feed that the problem appears on
problemName - String
Returns:
String