本文整理汇总了Java中com.sun.syndication.feed.synd.SyndFeed.getUri方法的典型用法代码示例。如果您正苦于以下问题:Java SyndFeed.getUri方法的具体用法?Java SyndFeed.getUri怎么用?Java SyndFeed.getUri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.syndication.feed.synd.SyndFeed
的用法示例。
在下文中一共展示了SyndFeed.getUri方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SyndEntryAdapter
import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
public SyndEntryAdapter(SyndFeed feed, SyndEntry entry) {
if (entry.getTitleEx() != null) {
this.title = entry.getTitle();
this.titleType = entry.getTitleEx().getType();
}
if (entry.getDescription() != null) {
this.description = entry.getDescription().getValue();
this.descriptionType = entry.getDescription().getType();
}
this.uri = entry.getUri();
this.author = entry.getAuthor();
this.link = entry.getLink();
if (entry.getPublishedDate() != null)
this.publishedDate = ISO_8601_DATE_FORMAT.format(entry.getPublishedDate());
if (entry.getUpdatedDate() != null)
this.updatedDate = ISO_8601_DATE_FORMAT.format(entry.getUpdatedDate());
this.fetchDate = ISO_8601_DATE_FORMAT.format(new Date());
this.sourceLink = feed.getLink();
this.sourceUri = feed.getUri();
this.sourceTitle = feed.getTitle();
this.language = feed.getLanguage();
this.sourceType = feed.getFeedType();
}
示例2: createRealFeed
import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
Channel channel = (Channel) super.createRealFeed(type,syndFeed);
if (syndFeed.getUri() != null) {
channel.setUri(syndFeed.getUri());
} else {
// if URI is not set use the value for link
channel.setUri(syndFeed.getLink());
}
return channel;
}
示例3: createRealFeed
import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
Channel channel = (Channel) super.createRealFeed(type,syndFeed);
if (syndFeed.getUri() != null) {
channel.setUri(syndFeed.getUri());
} else {
// if URI is not set use the value for link
channel.setUri(syndFeed.getLink());
}
return channel;
}
示例4: doPost
import com.sun.syndication.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String hubtopic = null;
String hubchallenge = null;
MessageStatus stsMessage = MessageStatus.ERROR;
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(SyndFeedInput.class.getClassLoader());
if (request.getContentType().contains(MediaType.APPLICATION_ATOM_XML)
|| request.getContentType().contains(MediaType.APPLICATION_RSS_XML)) {
InputStream in = request.getInputStream();
try {
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(new XmlReader(in));
List<SyndLinkImpl> linkList = feed.getLinks();
for (SyndLinkImpl link : linkList) {
if ("self".equals(link.getRel())) {
hubtopic = link.getHref();
}
}
if (hubtopic == null) {
hubtopic = feed.getUri();
}
topicUpdated(hubtopic, feed);
} catch (FeedException e) {
LOG.error("Failed in creating feed response.", e);
} finally {
Thread.currentThread().setContextClassLoader(cl);
}
stsMessage = MessageStatus.OK;
}
response.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
switch (stsMessage) {
case OK:
response.setStatus(HttpStatus.SC_OK);
break;
case OK_CHALLENGE:
response.setStatus(HttpStatus.SC_OK);
response.getWriter().print(hubchallenge);
break;
default:
response.setStatus(HttpStatus.SC_NOT_FOUND);
break;
}
}