Vincent's patch, that corrects the error when the favicon link points to a resource that does not exist:

http 404 ERROR. This error can be produced by the http://ddj.com/rss/all.xml;jsessionid=OEVRSWPBVGBOQQSNDLRSKHSCJUNN2JVN RSS feed.
The patch just creates a File with the url of the favicon and tests if this File really exists. If not, the function return the default RSS favicon.
cusax-fix
Yana Stamcheva 19 years ago
parent 21a706d2b4
commit a4e069da13

@ -239,10 +239,18 @@ public byte[] getImage()
try
{
URL location = new URL(feedLocation.getProtocol() + "://"
+ feedLocation.getHost() + "/favicon.ico");
ICOFile favicon = new ICOFile(location);
File fileLocation = new File(feedLocation.getProtocol() + "://"
+ feedLocation.getHost() + "/favicon.ico");
// If the '.ico' resource is not found on the server (http 404 ERROR -
// File Not Found), we return the default RSS '.ico'.
if(!fileLocation.exists())
{
return getDefaultRssIcon();
}
ICOFile favicon = new ICOFile(fileLocation.toURL());
logger.trace("Icon has " + favicon.getImageCount() + " pages");
for (int i = 0; i < favicon.getDescriptors().size(); i++)

Loading…
Cancel
Save