org.apache.commons.feedparser.locate.blogservice
Class Blosxom

java.lang.Object
  extended by org.apache.commons.feedparser.locate.blogservice.BlogService
      extended by org.apache.commons.feedparser.locate.blogservice.Blosxom

public class Blosxom
extends BlogService

Models the Blosxom blog service, encapsulating whether a given weblog is this type of service and where it usually keeps its feeds.

Author:
Brad Neuberg, bkn3@columbia.edu

Field Summary
 
Fields inherited from class org.apache.commons.feedparser.locate.blogservice.BlogService
blogServices, metaTagsPattern, patternToStrip
 
Constructor Summary
Blosxom()
           
 
Method Summary
 boolean followRedirects()
          Returns whether we should follow HTTP redirects for this blog service.
 String getBaseFeedPath(String resource)
          This method takes a resource, such as "http://www.codinginparadise.org/myweblog.php", and gets the path necessary to build up a feed, such as "http://www.codinginparadise.org/".
 FeedReference[] getFeedLocations(String resource, String content)
          Returns an array of FeedReferences that contains information on the usual locations this blog service contains its feed.
 boolean hasValidAutoDiscovery()
          Returns whether we can trust the results of this blog service's autodiscovery links.
 boolean isThisService(String resource, String content)
          Determines if the weblog at the given resource and with the given content is this blog service.
 
Methods inherited from class org.apache.commons.feedparser.locate.blogservice.BlogService
containsDomain, equals, getBlogServices, hasGenerator, hashCode, initializeBlogServices, isThisService, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Blosxom

public Blosxom()
Method Detail

hasValidAutoDiscovery

public boolean hasValidAutoDiscovery()
Returns whether we can trust the results of this blog service's autodiscovery links. For example, TextAmerica returns invalid autodiscovery results.

Specified by:
hasValidAutoDiscovery in class BlogService

followRedirects

public boolean followRedirects()
Returns whether we should follow HTTP redirects for this blog service. Some services don't implement HTTP redirects correctly, while others, like Xanga, require it.

Specified by:
followRedirects in class BlogService

isThisService

public boolean isThisService(String resource,
                             String content)
                      throws FeedParserException
Determines if the weblog at the given resource and with the given content is this blog service.

Specified by:
isThisService in class BlogService
Parameters:
resource - A full URI to this resource, such as "http://www.codinginparadise.org".
content - The full HTML content at the resource's URL.
Throws:
FeedParserException - Thrown if an error occurs while determining the type of this weblog.

getFeedLocations

public FeedReference[] getFeedLocations(String resource,
                                        String content)
                                 throws FeedParserException
Returns an array of FeedReferences that contains information on the usual locations this blog service contains its feed. The feeds should be ordered by quality, so that higher quality feeds come before lower quality ones (i.e. you would want to have an Atom FeedReference object come before an RSS 0.91 FeedReference object in this list).

Specified by:
getFeedLocations in class BlogService
Parameters:
resource - A URL to the given weblog that might be used to build up where feeds are usually located.
content - The full content of the resource URL, which might be useful to determine where feeds are usually located. This can be null.
Throws:
FeedParserException - Thrown if an error occurs while trying to determine the usual locations of feeds for this service.

getBaseFeedPath

public String getBaseFeedPath(String resource)
This method takes a resource, such as "http://www.codinginparadise.org/myweblog.php", and gets the path necessary to build up a feed, such as "http://www.codinginparadise.org/". Basicly it appends a slash to the end if there is not one, and removes any file names that might be at the end, such as "myweblog.php". There is a special exception for some Blosxom blogs, which have things inside of a cgi-script and 'hang' their RSS files off of this cgi-bin. For example, http://www.bitbucketheaven.com/cgi-bin/blosxom.cgi has its RSS file at http://www.bitbucketheaven.com/cgi-bin/blosxom.cgi/index.rss, so we must return the blosxom.cgi at the end as well for this method.

Overrides:
getBaseFeedPath in class BlogService
Throws:
MalformedURLException - Thrown if the given resource's URL is incorrectly formatted.


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.