Package com.sun.syndication.feed.synd

Examples of com.sun.syndication.feed.synd.SyndEnclosure


      entry.setUpdatedDate(item.getLastModified());

      // The enclosure is the media (audio or video) file of the episode
      Enclosure media = item.getEnclosure();
      if (media != null) {
        SyndEnclosure enclosure = new SyndEnclosureImpl();
        enclosure.setUrl(helper.getMediaUrl(item));
        enclosure.setType(media.getType());
        enclosure.setLength(media.getLength());
        // Also set the item link to point to the enclosure
        entry.setLink(helper.getMediaUrl(item));
        List<SyndEnclosure> enclosures = new ArrayList<SyndEnclosure>();
        enclosures.add(enclosure);
        entry.setEnclosures(enclosures);
View Full Code Here


    e.setLastModified(entry.getUpdatedDate());
    e.setPublishDate(entry.getPublishedDate());

    for (Object enclosure : entry.getEnclosures()) {
      if (enclosure instanceof SyndEnclosure) {
        SyndEnclosure syndEnclosure = (SyndEnclosure) enclosure;
        Enclosure media = new Enclosure();
        media.setExternalUrl(syndEnclosure.getUrl());
        media.setType(syndEnclosure.getType());
        media.setLength(syndEnclosure.getLength());
        e.setEnclosure(media);
      }
      // Break after one cycle because only one media file is supported
      break;
    }
View Full Code Here

          "AppCast, this is probably an error!");
     
      return;
    }
   
    SyndEnclosure enclosure = (SyndEnclosure)entry.getEnclosures().get(0);
    SparkleEnclosure senclosure = spk.getEnclosures().get(0);
   
    try {
      targetOperation.setDownloadUrl(new URL(enclosure.getUrl()));
    } catch (MalformedURLException e1) {
      throw new UpdateException("Can't parse download url", e1);
    }
   
    targetOperation.setDownloadSize(enclosure.getLength());
    targetOperation.setDsaSignature(senclosure.getDsaSignature());
    targetOperation.setMd5Sum(senclosure.getMd5Sum());
    targetOperation.setVersion(senclosure.getVersion());
    targetOperation.setShortVersion(senclosure.getShortVersionString());
  }
View Full Code Here

        return syndEntry;
    }

    public SyndEnclosure createSyndEnclosure(Feed feed, Entry entry,
            Link link) {
        SyndEnclosure syndEncl = new SyndEnclosureImpl();
        syndEncl.setUrl(link.getHrefResolved());
        syndEncl.setType(link.getType());
        syndEncl.setLength(link.getLength());
        return syndEncl;
    }
View Full Code Here

        }
        // add SyndEnclosures as links with rel="enclosure" ONLY if
        // there are no SyndEntry.getLinks() with rel="enclosure"
        if (enclosures != null && linkRelEnclosureExists == false) {
            for (Iterator iter=enclosures.iterator(); iter.hasNext();) {
                SyndEnclosure syndEncl = (SyndEnclosure)iter.next();
                Link link = createAtomEnclosure(syndEncl);
                otherLinks.add(link);
            }
        }
        if (alternateLinks.size() > 0) aEntry.setAlternateLinks(alternateLinks);
View Full Code Here

        return syndEntry;
    }

    public SyndEnclosure createSyndEnclosure(Entry entry, Link link) {
        SyndEnclosure syndEncl = new SyndEnclosureImpl();
        syndEncl.setUrl(link.getHrefResolved());
        syndEncl.setType(link.getType());
        syndEncl.setLength(link.getLength());
        return syndEncl;
    }
View Full Code Here

        }

        List sEnclosures = sEntry.getEnclosures();
        if (sEnclosures != null) {
            for (Iterator iter=sEnclosures.iterator(); iter.hasNext();) {
                SyndEnclosure syndEnclosure = (SyndEnclosure) iter.next();
                Link link = createAtomEnclosure(syndEnclosure);
                otherLinks.add(link);
            }
        }
View Full Code Here

    protected List createSyndEnclosures(List enclosures) {
        List sEnclosures = new ArrayList();
        for (int i=0;i<enclosures.size();i++) {
            Enclosure enc = (Enclosure) enclosures.get(i);
            SyndEnclosure sEnc = new SyndEnclosureImpl();
            sEnc.setUrl(enc.getUrl());
            sEnc.setType(enc.getType());
            sEnc.setLength(enc.getLength());
            sEnclosures.add(sEnc);
        }
        return sEnclosures;
    }
View Full Code Here

    }

    protected List createEnclosures(List sEnclosures) {
        List enclosures = new ArrayList();
        for (int i=0;i<sEnclosures.size();i++) {
            SyndEnclosure sEnc = (SyndEnclosure) sEnclosures.get(i);
            Enclosure enc = new Enclosure();
            enc.setUrl(sEnc.getUrl());
            enc.setType(sEnc.getType());
            enc.setLength(sEnc.getLength());
            enclosures.add(enc);
        }
        return enclosures;
    }
View Full Code Here

        return syndEntry;
    }

    public SyndEnclosure createSyndEnclosure(Feed feed, Entry entry,
            Link link) {
        SyndEnclosure syndEncl = new SyndEnclosureImpl();
        syndEncl.setUrl(link.getHrefResolved());
        syndEncl.setType(link.getType());
        syndEncl.setLength(link.getLength());
        return syndEncl;
    }
View Full Code Here

TOP

Related Classes of com.sun.syndication.feed.synd.SyndEnclosure

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.