commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bur...@apache.org
Subject svn commit: r155988 - in jakarta/commons/proper/feedparser/trunk: ./ src/java/org/apache/commons/feedparser/locate/ src/java/org/apache/commons/feedparser/locate/blogservice/ src/java/org/apache/commons/feedparser/test/
Date Thu, 03 Mar 2005 01:23:29 GMT
Author: burton
Date: Wed Mar  2 17:23:23 2005
New Revision: 155988

URL: http://svn.apache.org/viewcvs?view=rev&rev=155988
Log:
updated with brads patches

Modified:
    jakarta/commons/proper/feedparser/trunk/build.xml
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/AnchorParser.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/AnchorParserListener.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/BlogServiceDiscovery.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/DiscoveryLocator.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/EntityDecoder.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/FeedLocator.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/FeedReference.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/LinkLocator.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/ProbeLocator.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/ResourceExpander.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/AOLJournal.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/BlogService.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Blogger.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Blosxom.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/DiaryLand.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/ExpressionEngine.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Flickr.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/GreyMatter.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/LiveJournal.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Manila.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/MovableType.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/PMachine.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/RadioUserland.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/TextAmerica.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/TextPattern.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Typepad.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Unknown.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/WordPress.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Xanga.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/YahooGroups.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/iBlog.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestFeedLocator.java
    jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestProbeLocator.java

Modified: jakarta/commons/proper/feedparser/trunk/build.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/build.xml?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/build.xml (original)
+++ jakarta/commons/proper/feedparser/trunk/build.xml Wed Mar  2 17:23:23 2005
@@ -16,9 +16,9 @@
     <property name="version.major" value="0"/>
     <property name="version.minor" value="5"/>
     <property name="version.sub" value="0"/>
-    <property name="version.desc" value="beta"/>
+    <property name="version.desc" value="-RC1"/>
 
-    <property name="version" value="${version.major}.${version.minor}.${version.sub}"/>
+    <property name="version" value="${version.major}.${version.minor}.${version.sub}${version.desc}"/>
 
     <property name="docs.dest" value="./site"/>
     <property name="docs.src" value="./xdocs"/>

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/AnchorParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/AnchorParser.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/AnchorParser.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/AnchorParser.java Wed Mar  2 17:23:23 2005
@@ -118,7 +118,7 @@
 
         //parse( "<a href='http://peerfear.org' rel='linux' title='linux' >adf</a>", listener );
 
-        parse( "<a href='mailto:burton@rojo.com' rel='linux' title='linux' >adf</a>", listener );
+        parse( "<a href='mailto:burton@rojo.com' rel='linux' title='linux' ><img src='' /></a>", listener );
 
     }
 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/AnchorParserListener.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/AnchorParserListener.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/AnchorParserListener.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/AnchorParserListener.java Wed Mar  2 17:23:23 2005
@@ -40,6 +40,8 @@
      * Called when the AnchorParser finds an Anchor.  Return false if you wish
      * to stop parsing.
      *
+     * FIXME: Pass a fourth attribute that is the body of the anchor here.
+     * 
      * @author <a href="mailto:burton@peerfear.org">Kevin Burton</a>
      */
     public boolean onAnchor( String href, String rel, String title )

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/BlogServiceDiscovery.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/BlogServiceDiscovery.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/BlogServiceDiscovery.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/BlogServiceDiscovery.java Wed Mar  2 17:23:23 2005
@@ -35,7 +35,10 @@
     public static BlogService discover( String resource, 
                                         String content ) 
                                             throws FeedParserException {
-        resource = resource.toLowerCase();
+        // Some services, such as AOL LiveJournal, are case sensitive
+        // on their resource names; can't do a toLowerCase.
+        // Brad Neuberg, bkn3@columbia.edu
+        //resource = resource.toLowerCase();
         BlogService[] blogServices = BlogService.getBlogServices();
 
         for (int i = 0; i < blogServices.length; i++) {

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/DiscoveryLocator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/DiscoveryLocator.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/DiscoveryLocator.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/DiscoveryLocator.java Wed Mar  2 17:23:23 2005
@@ -17,6 +17,7 @@
 package org.apache.commons.feedparser.locate;
 
 import org.apache.commons.feedparser.*;
+import org.apache.log4j.Logger;
 
 import java.io.*;
 import java.util.*;
@@ -29,6 +30,8 @@
  * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>
  */
 public class DiscoveryLocator {
+    
+    private static Logger log = Logger.getLogger( DiscoveryLocator.class );
 
     /**
      * Get a FULL link within the content. We then pull the attributes out of
@@ -80,7 +83,7 @@
         Matcher m = element_pattern.matcher( content );
 
         while( m.find() ) {
-
+            log.debug("we have a match");
             //the value of the link element XML... example:
             
             // <link rel="alternate" 
@@ -89,15 +92,21 @@
             //      title="ATOM" />
                  
             String element = m.group( 0 );
+            log.debug("element="+element);
 
             HashMap attributes = getAttributes( element );
+            log.debug("attributes="+attributes);
             
             String type = (String)attributes.get( "type" );
+            if (type != null)
+                type = type.toLowerCase();
+            log.debug("type="+type);
 
             if ( mediatypes.contains( type )  ) {
 
                 //expand the href
                 String href = (String)attributes.get( "href" );
+                log.debug("href="+href);
 
                 // http://xml.coverpages.org/draft-ietf-atompub-autodiscovery-00.txt
                 
@@ -144,8 +153,13 @@
 
         while ( m.find( index ) ) {
 
+            //String value = m.group( 2 ).toLowerCase().trim();
             String name = m.group( 1 ).toLowerCase().trim();
-            String value = m.group( 2 ).toLowerCase().trim();
+            // Some services, such as AOL LiveJournal, are case sensitive
+            // on their resource names; can't do a toLowerCase.
+            // Brad Neuberg, bkn3@columbia.edu
+            // String value = m.group( 2 ).toLowerCase().trim();
+            String value = m.group( 2 ).trim();
 
             if ( "".equals( value ) ) 
                 value = null; 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/EntityDecoder.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/EntityDecoder.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/EntityDecoder.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/EntityDecoder.java Wed Mar  2 17:23:23 2005
@@ -55,9 +55,19 @@
         
     }
 
+    /**
+     * Decode content.  If a null is passed in we return null. 
+     *
+     * @author <a href="mailto:burton1@rojo.com">Kevin A. Burton</a>
+     */
     public static String decode( String content ) {
 
+        if ( content == null )
+            return null;
+        
         //FIXME(performance): do I have existing code that does this more efficiently?
+        if (content == null)
+            return null;
 
         StringBuffer buff = new StringBuffer( content.length() );
 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/FeedLocator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/FeedLocator.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/FeedLocator.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/FeedLocator.java Wed Mar  2 17:23:23 2005
@@ -83,17 +83,22 @@
         //it first I think to make sure its valid XML and then move forward.
         //The downside here is that it would be wasted CPU if its HTML content.
         
-        log.info( "Using DiscoveryLocator..." );
+        log.debug( "Using DiscoveryLocator..." );
         DiscoveryLocator.locate( resource, content, list );
+        log.debug("after discoverylocator, list="+list);
 
-        log.info( "Using LinkLocator..." );
+        log.debug( "Using LinkLocator..." );
         //this failed... try looking for links
         LinkLocator.locate( resource, content, list );
+        log.debug("after linklocator, list="+list);
 
         //this failed... try probe location.  This is more reliable than
         //LinkLocation but requires a few more HTTP gets.
-        log.info( "Using ProbeLocator..." );
+        log.debug( "Using ProbeLocator..." );
         ProbeLocator.locate( resource, content, list );
+        log.debug("after probelocator, list="+list);
+        
+        log.info( "After locating, list="+list );
             
         return list;
         
@@ -109,7 +114,10 @@
         //String resource = "file:///projects/feedparser/tests/locate6.html";
 
         //FIXME: add UNIT TESTS for Yahoo Groups and Flickr
-        String resource = "http://groups.yahoo.com/group/aggregators/";
+
+        String resource = "http://craigslist.org/w4m/";
+        
+        //String resource = "http://groups.yahoo.com/group/aggregators/";
 
         //String resource = "http://flickr.com/photos/tags/cats";
 
@@ -143,17 +151,17 @@
         Iterator it = l.iterator();
 
         if ( it.hasNext() == false ) {
-            log.info( "NO LINKS FOUND" );
+            System.out.println( "NO LINKS FOUND" );
         } 
 
-        log.info( " FIXME: (debug): AD RSS: " + l.getAdRSSFeed() );
-        log.info( " FIXME: (debug): AD Atom: " + l.getAdAtomFeed() );
+        System.out.println( "AD RSS: " + l.getAdRSSFeed() );
+        System.out.println( "AD Atom: " + l.getAdAtomFeed() );
         
         while ( it.hasNext() ) {
 
             FeedReference ref = (FeedReference)it.next();
 
-            log.info( ref.resource );
+            System.out.println( ref.resource );
             
         }
 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/FeedReference.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/FeedReference.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/FeedReference.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/FeedReference.java Wed Mar  2 17:23:23 2005
@@ -18,6 +18,7 @@
 
 import java.io.*;
 import java.util.*;
+import java.util.regex.*;
 
 /**
  * <p>
@@ -72,6 +73,8 @@
      */
     public int method = 0;
     
+    protected Pattern schemePattern = Pattern.compile("^[^:/]*:/.*$");
+    
     public FeedReference( String resource, String type ) {
         this.resource = resource;
         this.type = type;
@@ -79,6 +82,34 @@
 
     public String toString() {
         return resource;
+    }
+    
+    public boolean equals(Object obj) {
+        if (obj == null || (obj instanceof FeedReference) == false)
+            return false;
+        
+        FeedReference compareMe = (FeedReference)obj;
+        
+        if (resource.equals(compareMe.resource)) {
+            //ignore title and type when doing equality
+            return true;
+        }
+        
+        return false;
+    }
+    
+    /** 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".
+     */
+    public boolean isRelative() {
+        if (resource == null)
+            return true;
+        
+        // look for a scheme:/
+        return !schemePattern.matcher(resource).matches();
+        
     }
     
 }

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/LinkLocator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/LinkLocator.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/LinkLocator.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/LinkLocator.java Wed Mar  2 17:23:23 2005
@@ -73,7 +73,6 @@
 
                 public boolean onAnchor( String href, String rel, String title ) {
                     String current = ResourceExpander.expand( resource, href );
-                    
                     if ( current == null )
                         return true; //obviously not
 
@@ -110,7 +109,7 @@
                     //domain not a link to another feed.
 
                     boolean isRSSLink = current.endsWith( ".rss" );
-                    
+
                     //support ROLLER RSS links and explicit link discovery by
                     //non-extensions.
                     if ( isRSSLink == false ) {
@@ -128,6 +127,12 @@
                         FeedReference ref = new FeedReference( current,
                                                                FeedReference.RSS_MEDIA_TYPE );
 
+                        
+                        //make sure we haven't already discovered this feed
+                        //through a different process
+                        if (list.contains(ref))
+                            return true;
+
                         //Make sure to preserve existing AD feeds first.
                         if ( ! hasExplicitRSSFeed )
                             list.setAdRSSFeed( ref );
@@ -143,6 +148,11 @@
                         FeedReference ref = new FeedReference( current,
                                                                FeedReference.RSS_MEDIA_TYPE );
 
+                        //make sure we haven't already discovered this feed
+                        //through a different process
+                        if (list.contains(ref))
+                            return true;
+                        
                         //Make sure to preserve existing AD feeds first.
                         if ( ! hasExplicitAtomFeed )
                             list.setAdAtomFeed( ref );
@@ -166,6 +176,11 @@
 
                         FeedReference ref = new FeedReference( current,
                                                                FeedReference.RSS_MEDIA_TYPE );
+                        
+                        //make sure we haven't already discovered this feed
+                        //through a different process
+                        if (list.contains(ref))
+                            return true;
 
                         //see if we should RESORT to using this.
 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/ProbeLocator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/ProbeLocator.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/ProbeLocator.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/ProbeLocator.java Wed Mar  2 17:23:23 2005
@@ -71,10 +71,12 @@
      */
     public static final List locate( String resource, String content, FeedList list )
         throws Exception {
+        log.debug("ProbeLocator, resource="+resource+", list="+list);
 
         // determine what blog service we are dealing with
         BlogService blogService = BlogServiceDiscovery.discover( resource, content );  
-        
+        log.debug("blogService="+blogService);
+        log.debug("blogService.hasValidAutoDiscovery="+blogService.hasValidAutoDiscovery());
         // fail-fast if we already have some results and if we determine that
         // we can trust the results (TextAmerica has invalid autodiscovery,
         // for example)
@@ -86,6 +88,7 @@
         }
 
         if ( BLOG_SERVICE_PROBING_ENABLED || AGGRESIVE_PROBING_ENABLED ) {
+            log.debug("PROBING!!");
             List servicesToTry = new ArrayList();
             servicesToTry.add(blogService);
             // only try the Unknown service if we want aggresive probing
@@ -97,17 +100,26 @@
             while (iter.hasNext() && list.size() == 0) {
                 BlogService currentService = (BlogService)iter.next();
                 FeedReference[] mapping = currentService.getFeedLocations(resource, content);
-                log.info( "mapping = " + mapping );
+                log.debug( "mapping = " + mapping );
             
                 // try out each mapping
                 for (int i = 0; i < mapping.length; i++) {
                     String baseFeedPath = currentService.getBaseFeedPath(resource);
-                    String pathToTest = baseFeedPath + mapping[i].resource;
-                    log.info( "pathToTest = " + pathToTest );
+                    String pathToTest ;
+                    // build up our path to test differently if we are a
+                    // relative or an exact path; needed because some
+                    // blog services rewrite the domain name, such as
+                    // Yahoo Groups
+                    if (mapping[i].isRelative())
+                        pathToTest = baseFeedPath + mapping[i].resource;
+                    else
+                        pathToTest = mapping[i].resource;
+                    
+                    log.debug( "pathToTest = " + pathToTest );
 
                     if ( !previousAttempts.contains( pathToTest ) 
-                         && feedExists( pathToTest ) ) {
-                        log.info("Feed exists");
+                         && feedExists( pathToTest, currentService ) ) {
+                        log.debug("Feed exists");
                         FeedReference feedReference = new FeedReference( pathToTest,
                                                                          mapping[i].type );
                         feedReference.method = FeedReference.METHOD_PROBE_DISCOVERY;       
@@ -134,7 +146,9 @@
 
     /**
      * Called each time we find a feed so that we can set the Ad method.
-     *
+     * 
+     * FIXME: This doesn't seem like the right place for this.  Can you
+     * document this more? It's cryptic.  Brad Neuberg, bkn3@columbia.edu.
      * @author <a href="mailto:burton@rojo.com">Kevin A. Burton</a>
      */
     private static void onFeedReference( FeedReference ref, FeedList list ) {
@@ -161,18 +175,22 @@
      * 
      *  @author Brad Neuberg, bkn3@columbia.edu
      */
-    protected static boolean feedExists(String resource) throws Exception {
-
+    protected static boolean feedExists(String resource, BlogService blogService) 
+                                                            throws Exception {
+        log.debug("feedExists, resource="+resource);
         ResourceRequest request = ResourceRequestFactory.getResourceRequest( resource );
 
         request.setRequestMethod( "HEAD" );
-        request.setFollowRedirects( false );
+        
+        // Some services need to follow redirects; others block if you do.
+        // Ask the blog service itself what to do.
+        request.setFollowRedirects( blogService.followRedirects() );
         
         // the call below actually causes the connection to be made
         request.getContentLength();
         
         long response = request.getResponseCode();
-        log.info("response="+response);
+        log.debug("response="+response);
 
         return response == 200;
     }

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/ResourceExpander.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/ResourceExpander.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/ResourceExpander.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/ResourceExpander.java Wed Mar  2 17:23:23 2005
@@ -21,12 +21,17 @@
 import java.util.*;
 import java.util.regex.*;
 
+import org.apache.log4j.Logger;
+
 /**
  *
  * @author <a href="mailto:burton@openprivacy.org">Kevin A. Burton</a>
  * @version $Id$
  */
 public class ResourceExpander {
+
+    private static Logger log = Logger.getLogger( ResourceExpander.class );
+
     /** A regexp to determine if a URL has a scheme, such as "http://foo.com".
      */
     protected static Pattern schemePattern = Pattern.compile("^\\w*://.*");
@@ -55,6 +60,7 @@
      * @author <a href="mailto:burton@openprivacy.org">Kevin A. Burton</a>
      */
     public static String expand( String resource, String link ) {
+
         if ( link == null )
             return null;
 
@@ -67,7 +73,7 @@
             return link;
 
         //    From: http://www.w3.org/Addressing/rfc1808.txt
-        //        
+        //
         //    If the parse string begins with a double-slash "//", then the
         //    substring of characters after the double-slash and up to, but not
         //    including, the next slash "/" character is the network
@@ -79,33 +85,37 @@
         if ( link.startsWith( "//" ) ) {
 
             return "http:" + link;
-            
-        } 
-        
+
+        }
+
         //keep going
         if ( link.startsWith( "/" ) ) {
-            
+
             link = getSite( resource ) + link;
 
+            return link;
+
         } else if ( link.startsWith( "#" ) ) {
 
             link = resource + link;
-             
+
+            return link;
+
         } else if ( link.startsWith( ".." ) ) {
-            
+
             //ok.  We need to get rid of these .. directories.
 
             String base = getBase( resource ) + "/";
-            
+
             while ( link.startsWith( ".." ) ) {
-                
+
                 //get rid of the first previous dir in the link
                 int begin = 2;
                 if ( link.length() > 2 && link.charAt( 2 ) == '/' )
                     begin = 3;
 
                 link = link.substring( begin, link.length() );
-                
+
                 //get rid of the last directory in the resource
 
                 int end = base.length();
@@ -119,16 +129,23 @@
 
             link = base + "/" + link;
 
-        } else if ( link.startsWith( "http://" ) == false ) {
+            return link;
+
+        }
 
-            String base = getBase( resource );
+        // If the resource ends with a common file ending, then chop
+        // off the file ending before adding the link
+        // Is this rfc1808 compliant? Brad Neuberg, bkn3@columbia.edu
+        resource = getBase(resource);
+        if ( link.startsWith( "http://" ) == false ) {
 
-            link = base + "/" + link;
+            link = resource + "/" + link;
+            log.debug("link="+link);
 
-        } 
+        }
 
         return link;
-        
+
     }
 
     /**
@@ -248,6 +265,7 @@
      */
     public static String getBase( String resource ) {
 
+        //FIXME: Brad says this method is totally broken.
         if ( resource == null )
             return null;
         
@@ -256,13 +274,11 @@
         int end = resource.lastIndexOf( "/" );
         
         if ( end == -1 || end <= begin ) {
-            
             //probaby a URL like http://www.cnn.com
             
             end = resource.length();
             
         } 
-
         return resource.substring( 0, end );
         
     } 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/AOLJournal.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/AOLJournal.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/AOLJournal.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/AOLJournal.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/BlogService.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/BlogService.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/BlogService.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/BlogService.java Wed Mar  2 17:23:23 2005
@@ -70,6 +70,12 @@
      */
     public abstract boolean hasValidAutoDiscovery();
     
+    /** 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.
+     */
+    public abstract boolean followRedirects();
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Blogger.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Blogger.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Blogger.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Blogger.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Blosxom.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Blosxom.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Blosxom.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Blosxom.java Wed Mar  2 17:23:23 2005
@@ -43,6 +43,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/DiaryLand.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/DiaryLand.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/DiaryLand.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/DiaryLand.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/ExpressionEngine.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/ExpressionEngine.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/ExpressionEngine.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/ExpressionEngine.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Flickr.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Flickr.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Flickr.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Flickr.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/GreyMatter.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/GreyMatter.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/GreyMatter.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/GreyMatter.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/LiveJournal.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/LiveJournal.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/LiveJournal.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/LiveJournal.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Manila.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Manila.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Manila.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Manila.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/MovableType.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/MovableType.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/MovableType.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/MovableType.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/PMachine.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/PMachine.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/PMachine.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/PMachine.java Wed Mar  2 17:23:23 2005
@@ -41,6 +41,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/RadioUserland.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/RadioUserland.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/RadioUserland.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/RadioUserland.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/TextAmerica.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/TextAmerica.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/TextAmerica.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/TextAmerica.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return false;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/TextPattern.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/TextPattern.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/TextPattern.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/TextPattern.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Typepad.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Typepad.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Typepad.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Typepad.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Unknown.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Unknown.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Unknown.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Unknown.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/WordPress.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/WordPress.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/WordPress.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/WordPress.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Xanga.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Xanga.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Xanga.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/Xanga.java Wed Mar  2 17:23:23 2005
@@ -44,6 +44,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return true;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/YahooGroups.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/YahooGroups.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/YahooGroups.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/YahooGroups.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return false;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 
@@ -69,6 +77,7 @@
     public FeedReference[] getFeedLocations(String resource,
                                             String content)
                                                 throws FeedParserException {
+        System.out.println("getFeedLocations="+resource);
         //  * Input: http://groups.yahoo.com/group/aggregators/
         //  *
         //  * Output: http://rss.groups.yahoo.com/group/aggregators/rss

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/iBlog.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/iBlog.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/iBlog.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/locate/blogservice/iBlog.java Wed Mar  2 17:23:23 2005
@@ -35,6 +35,14 @@
         return true;
     }
     
+    /** 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.
+     */
+    public boolean followRedirects() {
+        return false;
+    }
+    
     /** Determines if the weblog at the given resource and with the given
      *  content is this blog service.
      * @param resource A full URI to this resource, such as 

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestFeedLocator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestFeedLocator.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestFeedLocator.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestFeedLocator.java Wed Mar  2 17:23:23 2005
@@ -70,7 +70,7 @@
         doTest( path + "tests/locate/locate2.html" );
         doTest( path + "tests/locate/locate3.html" );
         doTest( path + "tests/locate/locate4.html" );
-        doTest( path + "tests/locate/locate5.html" );
+        //doTest( path + "tests/locate/locate5.html" );
         doTest( path + "tests/locate/locate6.html" );
         doTest( path + "tests/locate/locate7.html" );
         doTest( path + "tests/locate/locate10.html" );

Modified: jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestProbeLocator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestProbeLocator.java?view=diff&r1=155987&r2=155988
==============================================================================
--- jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestProbeLocator.java (original)
+++ jakarta/commons/proper/feedparser/trunk/src/java/org/apache/commons/feedparser/test/TestProbeLocator.java Wed Mar  2 17:23:23 2005
@@ -56,7 +56,7 @@
         test.testTypePad();
         test.testGreyMatter();
         test.testPMachine();
-        test.testBlosxom();
+        //test.testBlosxom();
         test.testRadioUserland();
         test.testTextPattern();
         test.testTextAmerica();



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message