From: <jbo...@li...> - 2005-11-23 01:59:34
|
Author: wrzep Date: 2005-11-22 20:58:59 -0500 (Tue, 22 Nov 2005) New Revision: 1630 Modified: trunk/forge/portal-extensions/forge-podcast/src/java/org/jboss/forge/podcast/Podcast.java Log: removed annoying debug msgs http://jira.jboss.com/jira/browse/JBLAB-538 Pawel Modified: trunk/forge/portal-extensions/forge-podcast/src/java/org/jboss/forge/podcast/Podcast.java =================================================================== --- trunk/forge/portal-extensions/forge-podcast/src/java/org/jboss/forge/podcast/Podcast.java 2005-11-23 01:44:38 UTC (rev 1629) +++ trunk/forge/portal-extensions/forge-podcast/src/java/org/jboss/forge/podcast/Podcast.java 2005-11-23 01:58:59 UTC (rev 1630) @@ -34,6 +34,8 @@ import java.util.SimpleTimeZone; import java.net.URL; +import java.net.HttpURLConnection; +import java.net.URLConnection; import java.net.MalformedURLException; import java.io.IOException; @@ -65,6 +67,8 @@ import de.nava.informa.core.ImageIF; import de.nava.informa.core.ParseException; +//import org.apache.commons.logging.LogFactory; + /** * A class holding the podcast feeds. * @@ -262,6 +266,15 @@ * @return Set of all items from feeds described in the given Set. */ private Set<ItemIF> getAllItems(Set<Map<String,Node>> nodes) { + /* + LogFactory lf = LogFactory.getFactory(); + //org.apache.commons.logging.log = lf.getInstance(FeedParser.class) + String[] atribs = lf.getAttributeNames(); + for (int i = 0; i < atribs.length; i++) { + System.out.println("atrib " + atribs[i] + " = " + lf.getAttribute(atribs[i])); + } + */ + HashSet<ItemIF> ret = new HashSet<ItemIF>(); Node urlNode = null; @@ -277,13 +290,23 @@ if (urlString.charAt(0) == '/') { // local link urlString = serverAdress + urlString; } - URL url = new URL(urlString); + URL url = new URL(urlString); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + Date date = new Date(connection.getDate()); + //System.out.println("date: " + date + " (" + urlString + ")"); - ChannelIF channel = FeedParser.parse(new ChannelBuilder(), url); + HttpURLConnection con = (HttpURLConnection) url.openConnection(); + con.setRequestMethod("HEAD"); + con.connect(); + date = new Date(con.getDate()); + //System.out.println("date: " + date + " (" + urlString + ")"); + + ChannelIF channel = FeedParser.parse(new ChannelBuilder(), url.openStream()); ret.addAll(channel.getItems()); } catch (IOException e) { log.warn(urlString + " could not be found."); + //e.printStackTrace(); } catch (ParseException e) { log.warn("Parse error: " + urlString); } |