Hi Kevin.  Did you rerun the unit tests after that
change to make sure they work?

Brad

--- "Kevin A. Burton" <[EMAIL PROTECTED]> wrote:

> Brad Neuberg wrote:
> 
> > It looks like attachments are stripped out of the
> mailing list; here 
> > is the patch in unified diff format:
> >
> I rewrote getFeedPath
> 
> 1.  it was using duplicate indexOf queries for the
> same value.  Wasted 
> CPU :-/  Also I used lastIndexOf to start scan from
> the end of the string.
> 
> 2.  It stripped text after # or ? but not both... so
> 
> http://foo.com?cat=dog#here
> 
> would not work...
> 
> Here is the new method body:
> 
> >    protected static String getFeedPath( String
> resource ) 
> >
> >        throws MalformedURLException {
> >
> >        
> >
> >        // strip off any query string or anchors
> >
> >        int end = resource.lastIndexOf( "#" );
> >
> >        
> >
> >        if ( end != -1 )
> >
> >            resource = resource.substring( 0, end
> );
> >
> >        end = resource.lastIndexOf( "?" );
> >
> >        if ( end != -1 )
> >
> >            resource = resource.substring( 0, end
> );
> >
> >        if ( ! resource.endsWith( "blosxom.cgi" ) )
> {
> >
> >            Matcher fileMatcher =
> patternToStrip.matcher(resource);
> >
> >            resource = fileMatcher.replaceAll("");
> >
> >        }
> >
> >        
> >
> >        if ( ! resource.endsWith( "/" ) ) {
> >
> >            resource = resource + "/";
> >
> >        }
> >
> >        
> >
> >        return resource;
> >
> >    }
> >
> 
> 
> Kevin
> 
> -- 
> 
> Please reply using PGP.
> 
>     http://peerfear.org/pubkey.asc    
>     
>     NewsMonster - http://www.newsmonster.org/
>     
> Kevin A. Burton, Location - San Francisco, CA, Cell
> - 415.595.9965
>        AIM/YIM - sfburtonator,  Web -
> http://peerfear.org/
> GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D
> 8D04 99F1 4412
>   IRC - freenode.net #infoanarchy | #p2p-hackers |
> #newsmonster
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to