• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SyndEnclosureImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.syndication.feed.synd.SyndEnclosureImpl的典型用法代码示例。如果您正苦于以下问题:Java SyndEnclosureImpl类的具体用法?Java SyndEnclosureImpl怎么用?Java SyndEnclosureImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SyndEnclosureImpl类属于com.sun.syndication.feed.synd包,在下文中一共展示了SyndEnclosureImpl类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getEnclosures

import com.sun.syndication.feed.synd.SyndEnclosureImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public List getEnclosures() {
    List<SyndEnclosure> enc = super.getEnclosures();
    List<SyndEnclosure> result = new ArrayList<SyndEnclosure>(enc.size());
    for (SyndEnclosure e : enc) {
        SyndEnclosureImpl ee = new SyndEnclosureImpl();
        if (e != null) {
            ee.setLength(e.getLength());
            ee.setType(removeInvalidChars(e.getType()));
            ee.setUrl(removeInvalidChars(e.getUrl()));
        }
        result.add(ee);
    }
    return result;
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:17,代码来源:ExtendedSyndEntryImpl.java


示例2: createSyndEnclosure

import com.sun.syndication.feed.synd.SyndEnclosureImpl; //导入依赖的package包/类
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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:9,代码来源:ConverterForAtom10.java


示例3: createSyndEnclosure

import com.sun.syndication.feed.synd.SyndEnclosureImpl; //导入依赖的package包/类
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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:8,代码来源:ConverterForAtom03.java


示例4: createSyndEnclosures

import com.sun.syndication.feed.synd.SyndEnclosureImpl; //导入依赖的package包/类
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;
}
 
开发者ID:4thline,项目名称:feeds,代码行数:13,代码来源:ConverterForRSS092.java


示例5: createSyndEnclosure

import com.sun.syndication.feed.synd.SyndEnclosureImpl; //导入依赖的package包/类
public SyndEnclosure createSyndEnclosure(Feed feed, Entry entry,
        Link link) {
    SyndEnclosure syndEncl = new SyndEnclosureImpl();
    syndEncl.setUrl(link.getHref());
    syndEncl.setType(link.getType());
    syndEncl.setLength(link.getLength());
    return syndEncl;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:9,代码来源:ConverterForAtom10.java


示例6: rss

import com.sun.syndication.feed.synd.SyndEnclosureImpl; //导入依赖的package包/类
public String rss() throws IOException, FeedException {
    SyndFeed feed = new SyndFeedImpl();
    feed.setTitle("hiscores.shmup.com");
    feed.setFeedType("rss_2.0");
    feed.setDescription("hiscores.shmup.com");
    feed.setLink("http://hiscores.shmup.com");
    List entries = new ArrayList();
    feed.setEntries(entries);
    for (Score score : scores) {
        SyndEntry entry = new SyndEntryImpl();
        entry.setTitle(score.getGameTitle());
        entry.setAuthor(score.player.name);
        entry.setLink("http://hiscores.shmup.com/score/" + score.id);
        SyndContentImpl content = new SyndContentImpl();
        content.setValue(score.tweet());
        entry.setDescription(content);
        entry.setPublishedDate(score.getCreatedAt());
        entry.setUpdatedDate(score.getCreatedAt());
        SyndEnclosureImpl enclosure = new SyndEnclosureImpl();
        enclosure.setUrl(score.game.cover);
        enclosure.setType(score.game.getCoverType());
        entry.setEnclosures(Lists.newArrayList(enclosure));
        entries.add(entry);
    }
    Writer writer = new StringWriter();
    SyndFeedOutput output = new SyndFeedOutput();
    output.output(feed, writer);
    writer.close();
    Controller.response().setContentType("application/rss+xml");
    return writer.toString();
}
 
开发者ID:jsmadja,项目名称:shmuphiscores,代码行数:32,代码来源:Timeline.java


示例7: RSSFeed

import com.sun.syndication.feed.synd.SyndEnclosureImpl; //导入依赖的package包/类
/**
    * Constructor. The identityKey is needed to generate personal URLs for the corresponding user.
    */
protected RSSFeed(final Feed feed, final Identity identity, final Long courseId, final String nodeId,final Translator translator, RepositoryService repositoryService) {
       super();

       // This helper object is required for generating the appropriate URLs for
       // the given user (identity)
	final FeedViewHelper helper = new FeedViewHelper(feed, identity, courseId, nodeId, translator, repositoryService);

       setFeedType("rss_2.0");
       setEncoding(RSSServlet.DEFAULT_ENCODING);
       setTitle(feed.getTitle());
       // According to the rss specification, the feed channel description is not
       // (explicitly) allowed to contain html tags.
       String strippedDescription = FilterFactory.getHtmlTagsFilter().filter(feed.getDescription());
       strippedDescription = strippedDescription.replaceAll("&nbsp;", " "); // TODO: remove when filter
       // does it
       setDescription(strippedDescription);
       setLink(helper.getJumpInLink());

       setPublishedDate(feed.getLastModified());
       // The image
       if (feed.getImageName() != null) {
           final SyndImage image = new SyndImageImpl();
           image.setDescription(feed.getDescription());
           image.setTitle(feed.getTitle());
           image.setLink(getLink());
           image.setUrl(helper.getImageUrl());
           setImage(image);
       }

       final List<SyndEntry> episodes = new ArrayList<SyndEntry>();
       for (final Item item : feed.getPublishedItems()) {
           final SyndEntry entry = new SyndEntryImpl();
           entry.setTitle(item.getTitle());

           final SyndContent itemDescription = new SyndContentImpl();
           itemDescription.setType("text/plain");
           itemDescription.setValue(helper.getItemDescriptionForBrowser(item));
           entry.setDescription(itemDescription);

           // Link will also be converted to the rss guid tag. Except if there's an
           // enclosure, then the enclosure url is used.
           // Use jump-in link far all entries. This will be overriden if the item
           // has an enclosure.
           entry.setLink(helper.getJumpInLink() + "#" + item.getGuid());
           entry.setPublishedDate(item.getPublishDate());
           entry.setUpdatedDate(item.getLastModified());

           // The enclosure is the media (audio or video) file of the episode
           final Enclosure media = item.getEnclosure();
           if (media != null) {
               final 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));
               final List<SyndEnclosure> enclosures = new ArrayList<SyndEnclosure>();
               enclosures.add(enclosure);
               entry.setEnclosures(enclosures);
           }

           episodes.add(entry);
       }
       setEntries(episodes);
   }
 
开发者ID:huihoo,项目名称:olat,代码行数:69,代码来源:RSSFeed.java


示例8: RSSFeed

import com.sun.syndication.feed.synd.SyndEnclosureImpl; //导入依赖的package包/类
/**
 * Constructor. The identityKey is needed to generate personal URLs for the corresponding user.
 */
protected RSSFeed(final Feed feed, final Identity identity, final Long courseId, final String nodeId, final Translator translator, RepositoryService repositoryService) {
    super();

    // This helper object is required for generating the appropriate URLs for
    // the given user (identity)
    final FeedViewHelper helper = new FeedViewHelper(feed, identity, courseId, nodeId, translator, repositoryService);

    setFeedType("rss_2.0");
    setEncoding(DEFAULT_ENCODING);
    setTitle(feed.getTitle());
    // According to the rss specification, the feed channel description is not
    // (explicitly) allowed to contain html tags.
    String strippedDescription = FilterFactory.getHtmlTagsFilter().filter(feed.getDescription());
    strippedDescription = strippedDescription.replaceAll("&nbsp;", " "); // TODO: remove when filter
    // does it
    setDescription(strippedDescription);
    setLink(helper.getJumpInLink());

    setPublishedDate(feed.getLastModified());
    // The image
    if (feed.getImageName() != null) {
        final SyndImage image = new SyndImageImpl();
        image.setDescription(feed.getDescription());
        image.setTitle(feed.getTitle());
        image.setLink(getLink());
        image.setUrl(helper.getImageUrl());
        setImage(image);
    }

    final List<SyndEntry> episodes = new ArrayList<SyndEntry>();
    for (final Item item : feed.getPublishedItems()) {
        final SyndEntry entry = new SyndEntryImpl();
        entry.setTitle(item.getTitle());

        final SyndContent itemDescription = new SyndContentImpl();
        itemDescription.setType("text/plain");
        itemDescription.setValue(helper.getItemDescriptionForBrowser(item));
        entry.setDescription(itemDescription);

        // Link will also be converted to the rss guid tag. Except if there's an
        // enclosure, then the enclosure url is used.
        // Use jump-in link far all entries. This will be overriden if the item
        // has an enclosure.
        entry.setLink(helper.getJumpInLink() + "#" + item.getGuid());
        entry.setPublishedDate(item.getPublishDate());
        entry.setUpdatedDate(item.getLastModified());

        // The enclosure is the media (audio or video) file of the episode
        final Enclosure media = item.getEnclosure();
        if (media != null) {
            final 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));
            final List<SyndEnclosure> enclosures = new ArrayList<SyndEnclosure>();
            enclosures.add(enclosure);
            entry.setEnclosures(enclosures);
        }

        episodes.add(entry);
    }
    setEntries(episodes);
}
 
开发者ID:huihoo,项目名称:olat,代码行数:69,代码来源:RSSFeed.java



注:本文中的com.sun.syndication.feed.synd.SyndEnclosureImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PrimitiveType类代码示例发布时间:2022-05-23
下一篇:
Java PrivAES128类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap