podcastID = Long.parseLong(request.getParameter("podcastId"));
} catch (NumberFormatException ex) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
throw ex;
}
Podcast podcast = null;
try {
podcast = podcastManager.getPodcastByID(podcastID, true);
} catch (Throwable ex) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
if (podcast == null) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
out.close();
return;
}
out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
out.println("<rss version=\"2.0\">");
out.println("<channel>");
out.println("<title>" + podcast.getTitle() + "</title>");
out.println("<description>" + podcast.getDescription() + "</description>");
out.println("<link>www.podcastee.cz</link>"); // TODO tady nevim co sem presne patri asi nic dulezityho
out.println("<language>en-us</language>");
out.println("<copyright>Copyright 2010</copyright>");
//for()
out.println("<lastBuildDate>Sat, 25 Mar 2010 11:30:00 -0500</lastBuildDate>");
out.println("<pubDate>" + podcast.getDateOfCreation() + "</pubDate>");
out.println("<docs>http://blogs.law.harvard.edu/tech/rss</docs>");
out.println("<webMaster>rob@podcast411.com</webMaster>");
for (Episode episode : podcast.getEpisodes()) {
File episodeFile = new File(podcastsPath + "/" + episode.getFileName());
if (!episodeFile.exists()) {
continue;
}