本文整理汇总了Java中com.rometools.rome.feed.synd.SyndFeed.getTitle方法的典型用法代码示例。如果您正苦于以下问题:Java SyndFeed.getTitle方法的具体用法?Java SyndFeed.getTitle怎么用?Java SyndFeed.getTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rometools.rome.feed.synd.SyndFeed
的用法示例。
在下文中一共展示了SyndFeed.getTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RSSSubscription
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
public RSSSubscription(URL url, String id, ArrayList<String> subscriber, long lastDate, long lastCheck) {
SyndFeed feed = RSSUtil.getElements(url);
if (feed != null) {
feedURL = url;
ID = id;
title = feed.getTitle();
//Assume the first element is the newest and get the date
this.lastDate = lastDate == -1 ? feed.getEntries().get(0).getPublishedDate().getTime() : lastDate;
this.lastCheck = lastCheck == -1 ? System.currentTimeMillis() : lastCheck;
subscribers = subscriber;
System.out.println("Successfully added RSS: " + url.toString());
} else {
System.out.println("Unable to add RSS: " + url.toString());
}
}
示例2: createFeed
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
@Override
public Feed createFeed(String url, SyndFeed syndFeed) {
String title = syndFeed.getTitle();
if (title == null) title = "RSS";
title = StringUtils.truncateUtf8(title, MAX_AUTHOR_NAME_LENGTH);
KeyPair keyPair = cryptoComponent.generateSignatureKeyPair();
LocalAuthor localAuthor = authorFactory
.createLocalAuthor(title,
keyPair.getPublic().getEncoded(),
keyPair.getPrivate().getEncoded());
Blog blog = blogFactory.createFeedBlog(localAuthor);
long added = clock.currentTimeMillis();
return new Feed(url, blog, localAuthor, added);
}
示例3: fetchSyndFeed
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
private SyndFeed fetchSyndFeed(String url)
throws FeedException, IOException {
// fetch feed
SyndFeed f = getSyndFeed(getFeedInputStream(url));
if (f.getEntries().size() == 0)
throw new FeedException("Feed has no entries");
// clean title
String title =
StringUtils.isNullOrEmpty(f.getTitle()) ? null : f.getTitle();
if (title != null) title = clean(title, STRIP_ALL);
f.setTitle(title);
// clean description
String description =
StringUtils.isNullOrEmpty(f.getDescription()) ? null :
f.getDescription();
if (description != null) description = clean(description, STRIP_ALL);
f.setDescription(description);
// clean author
String author =
StringUtils.isNullOrEmpty(f.getAuthor()) ? null : f.getAuthor();
if (author != null) author = clean(author, STRIP_ALL);
f.setAuthor(author);
return f;
}
示例4: getExtLibFeed
import com.rometools.rome.feed.synd.SyndFeed; //导入方法依赖的package包/类
private ExtLibFeed getExtLibFeed(String uri) throws LibException {
SyndFeed feed = getFeed(uri);
List<OPDSEntryI> entries = feed.getEntries().stream().map(ExtLibOPDSEntry::new).
collect(Collectors.toList());
ArrayList<OPDSLink> links = new ArrayList<>();
Optional<SyndLink> nextPage = feed.getLinks().stream().
filter(syndLink -> REL_NEXT.equals(syndLink.getRel())).findFirst();
nextPage.ifPresent(syndLink -> links.add(ExtLibOPDSEntry.mapLink(syndLink)));
return new ExtLibFeed(feed.getTitle(), entries, links);
}