Search in sources :

Example 1 with SyndEnclosureImpl

use of com.rometools.rome.feed.synd.SyndEnclosureImpl in project opencast by opencast.

the class RomeRssFeed method toRomeEnclosures.

/**
 * Converts a list of enclosures to a <code>ROME</code> enclosure list.
 *
 * @param enclosures
 *          original enclosures
 * @return <code>ROME</code> enclosure list
 */
private List<SyndEnclosure> toRomeEnclosures(List<Enclosure> enclosures) {
    if (enclosures == null)
        return Collections.emptyList();
    List<SyndEnclosure> romeEnclosures = new ArrayList<SyndEnclosure>(enclosures.size());
    for (Enclosure enclosure : enclosures) {
        SyndEnclosureImpl romeEnclosure = new SyndEnclosureImpl();
        romeEnclosure.setLength(enclosure.getLength());
        romeEnclosure.setType(enclosure.getType());
        romeEnclosure.setUrl(enclosure.getUrl());
        romeEnclosures.add(romeEnclosure);
    }
    return romeEnclosures;
}
Also used : SyndEnclosure(com.rometools.rome.feed.synd.SyndEnclosure) ArrayList(java.util.ArrayList) Enclosure(org.opencastproject.feed.api.Enclosure) SyndEnclosure(com.rometools.rome.feed.synd.SyndEnclosure) SyndEnclosureImpl(com.rometools.rome.feed.synd.SyndEnclosureImpl)

Aggregations

SyndEnclosure (com.rometools.rome.feed.synd.SyndEnclosure)1 SyndEnclosureImpl (com.rometools.rome.feed.synd.SyndEnclosureImpl)1 ArrayList (java.util.ArrayList)1 Enclosure (org.opencastproject.feed.api.Enclosure)1