org.apache.commons.feedparser
Class ContentDetector

java.lang.Object
  |
  +--org.apache.commons.feedparser.ContentDetector

public class ContentDetector
extends java.lang.Object

Given the RAW content of a URL, determine if we're looking at an RSS file or an HTML file. We also return the given RSS version or Atom version.

Version:
$Id: ContentDetector.java 159215 2005-03-27 23:36:16Z burton $

Constructor Summary
ContentDetector()
           
 
Method Summary
static ContentDetectorResult detect(java.lang.String content)
          Return true if the given content seems to be RSS.
static boolean isAtomContent(java.lang.String content)
           
static boolean isHTMLContent(java.lang.String content)
          Return true if this is RSS 2.0 content
static boolean isRSS_0_9_0_Content(java.lang.String content)
          Return true if this is RSS 2.0 content
static boolean isRSS_0_9_1_Content(java.lang.String content)
          Return true if this is RSS 2.0 content
static boolean isRSS_0_9_2_Content(java.lang.String content)
          Return true if this is RSS 0.9.2 content
static boolean isRSS_1_0_Content(java.lang.String content)
          Return true if this is RSS 1.0 content
static boolean isRSS_2_0_Content(java.lang.String content)
          Return true if this is RSS 2.0 content
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentDetector

public ContentDetector()
Method Detail

detect

public static ContentDetectorResult detect(java.lang.String content)
                                    throws java.lang.Exception
Return true if the given content seems to be RSS. This is going to be a cheat because really we have no way of telling if this is RSS other than if it is XML and it starts with an RSS 1.0, 2.0, 0.91 or 0.9 decl

java.lang.Exception

isRSS_1_0_Content

public static boolean isRSS_1_0_Content(java.lang.String content)
                                 throws java.lang.Exception
Return true if this is RSS 1.0 content

java.lang.Exception

isRSS_0_9_1_Content

public static boolean isRSS_0_9_1_Content(java.lang.String content)
                                   throws java.lang.Exception
Return true if this is RSS 2.0 content

java.lang.Exception

isRSS_0_9_2_Content

public static boolean isRSS_0_9_2_Content(java.lang.String content)
                                   throws java.lang.Exception
Return true if this is RSS 0.9.2 content

java.lang.Exception

isRSS_2_0_Content

public static boolean isRSS_2_0_Content(java.lang.String content)
                                 throws java.lang.Exception
Return true if this is RSS 2.0 content

java.lang.Exception

isRSS_0_9_0_Content

public static boolean isRSS_0_9_0_Content(java.lang.String content)
                                   throws java.lang.Exception
Return true if this is RSS 2.0 content

java.lang.Exception

isAtomContent

public static boolean isAtomContent(java.lang.String content)
                             throws java.lang.Exception
java.lang.Exception

isHTMLContent

public static boolean isHTMLContent(java.lang.String content)
                             throws java.lang.Exception
Return true if this is RSS 2.0 content

java.lang.Exception

main

public static void main(java.lang.String[] args)


Copyright © 2004-2006 Apache Software Foundation. All Rights Reserved.