}else{
String id = path.substring( 1 );
Subscription subscription = null;
for ( Subscription s: subs ){
if ( s.getID().equals( id )){
subscription = s;
break;
}
}
if ( subscription == null ){
response.setReplyStatus( 404 );
return( true );
}
URL feed_url = url;
// absolute url is borked as it doesn't set the host properly. hack
String host = (String)request.getHeaders().get( "host" );
if ( host != null ){
int pos = host.indexOf( ':' );
if ( pos != -1 ){
host = host.substring( 0, pos );
}
feed_url = UrlUtils.setHost( url, host );
}
response.setContentType( "application/xml" );
pw.println( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" );
pw.println(
"<rss version=\"2.0\" " +
"xmlns:vuze=\"http://www.vuze.com\" " +
"xmlns:media=\"http://search.yahoo.com/mrss/\" " +
"xmlns:atom=\"http://www.w3.org/2005/Atom\" " +
"xmlns:itunes=\"http://www.itunes.com/dtds/podcast-1.0.dtd\">" );
pw.println( "<channel>" );
String channel_title = "Vuze Subscription: " + escape( subscription.getName());
pw.println( "<title>" + channel_title + "</title>" );
pw.println( "<link>http://vuze.com</link>" );
pw.println( "<atom:link href=\"" + escape( feed_url.toExternalForm()) + "\" rel=\"self\" type=\"application/rss+xml\" />" );
pw.println( "<description>Vuze RSS Feed for subscription " + escape( subscription.getName()) + "</description>" );
pw.println("<itunes:image href=\"http://www.vuze.com/img/vuze_icon_128.png\"/>");
pw.println("<image><url>http://www.vuze.com/img/vuze_icon_128.png</url><title>" + channel_title + "</title><link>http://vuze.com</link></image>");
SubscriptionResult[] results = subscription.getResults();
String feed_date_key = "subscriptions.feed_date." + subscription.getID();
long feed_date = COConfigurationManager.getLongParameter( feed_date_key );
boolean new_date = false;