本文整理汇总了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(" ", " "); // 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(" ", " "); // 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;未经允许,请勿转载。 |
请发表评论