Package org.torrcast.model

Examples of org.torrcast.model.PodcastItem


                List<SyndEntry> entries = feed.getEntries();
                for (SyndEntry entry : entries) {
                    String entryUri = entry.getUri();
                    if (!items.containsKey(entryUri)) {
                        // Identified a new podcast entry. Add it to the Podcast.
                        PodcastItem item = FeedUtils.createPodcastItem(entry);
                       
                        if (logger.isTraceEnabled()) {
                            logger.trace("Created PodcastItem " + item);
                        }
View Full Code Here


        return "test";
    }

    @RequestMapping({"/download.do"})
    public String download() {
        PodcastItem item = podcastDao.getLatestItem();
        logger.debug("Downloading podcast: " + ReflectionToStringBuilder.toString(item));
        podcastDownloader.downloadItem(item);
        return "test";
    }
View Full Code Here

    /**
     * Create a new {@link PodcastItem} based on a {@link SyndEntry}.
     */
    @SuppressWarnings("unchecked")
    public static PodcastItem createPodcastItem(SyndEntry entry) {
        PodcastItem item = new PodcastItem();
        item.setDescription(getSyndContentValue(entry.getDescription()));
        item.setPublishedDate(entry.getPublishedDate());
        item.setTitle(entry.getTitle());

        // Get the file url referred to in the podcast. Although specifications
        // state that there may be more than one enclosure per file, I'll only
        // care about one per file. Podcast entries referring to more than one
        // file doesn't feel quite right...
        List<SyndEnclosure> enclosures = entry.getEnclosures();
        if (enclosures.isEmpty()) {
            logger.warn("No enclosures found in item (uri=" + entry.getUri() + ")");
        } else {
            if (enclosures.size() > 1) {
                logger.warn("Too many enclosures found in item (uri=" + entry.getUri() + "): " + enclosures.size());
            }
           
            // Use the first entry (there should be only one).
            item.setFileUrl(enclosures.get(0).getUrl());
        }

        return item;
    }
View Full Code Here

TOP

Related Classes of org.torrcast.model.PodcastItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.