org.apache.commons.feedparser.locate
Class FeedReference

java.lang.Object
  extended by org.apache.commons.feedparser.locate.FeedReference

public class FeedReference
extends Object

A FeedReference is used within the RSS/Atom location facility to pass back metadata for feed discoveries.

Right now we pass back the URL to the feeds as the `resource' parameter. The media type (application/rss+xml, application/atom+xml, etc) as the type param (which is optional). We also pass back the `title' back if its specified within autodiscovery. This will be null if another discovery method is used.

Its important to realize that the media type is only given if we're 100% certain of the value. If we have to use probe discovery or link discovery it might not be possible to obtain the media type without antoher network request (via HTTP headers).

Note that internally (within the ProbeLocator) we don't use absolute resource URLs but use relative ones and use the media type as the default media type.

Author:
Kevin A. Burton

Field Summary
static String ATOM_MEDIA_TYPE
           
 int method
          The method of discovery...
static int METHOD_AUTO_DISCOVERY
           
static int METHOD_LINK_DISCOVERY
           
static int METHOD_PROBE_DISCOVERY
           
 String resource
          The network addressable resource forfor this feed.
static String RSS_MEDIA_TYPE
           
protected  Pattern schemePattern
           
 String title
          The title of the reference.
 String type
          The media type of this feed.
static String XML_MEDIA_TYPE
           
 
Constructor Summary
FeedReference(String resource, String type)
           
 
Method Summary
 boolean equals(Object obj)
           
 boolean isRelative()
          Determines if the resource given by this FeedReference is relative.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATOM_MEDIA_TYPE

public static final String ATOM_MEDIA_TYPE
See Also:
Constant Field Values

RSS_MEDIA_TYPE

public static final String RSS_MEDIA_TYPE
See Also:
Constant Field Values

XML_MEDIA_TYPE

public static final String XML_MEDIA_TYPE
See Also:
Constant Field Values

METHOD_AUTO_DISCOVERY

public static int METHOD_AUTO_DISCOVERY

METHOD_PROBE_DISCOVERY

public static int METHOD_PROBE_DISCOVERY

METHOD_LINK_DISCOVERY

public static int METHOD_LINK_DISCOVERY

resource

public String resource
The network addressable resource forfor this feed.


type

public String type
The media type of this feed.


title

public String title
The title of the reference. Usually FOAF, RSS or Atom per auto-discovery link.


method

public int method
The method of discovery...


schemePattern

protected Pattern schemePattern
Constructor Detail

FeedReference

public FeedReference(String resource,
                     String type)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

isRelative

public boolean isRelative()
Determines if the resource given by this FeedReference is relative. For example, the resource could be '/atom.xml', which is relative. It could also be "http://rss.groups.yahoo.com/group/talkinaboutarchitecture/rss".



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