use of com.rometools.rome.feed.rss.Channel in project tutorials by eugenp.
the class ArticleFeedView method newFeed.
protected Channel newFeed() {
Channel channel = new Channel("rss_2.0");
channel.setLink("http://localhost:8080/rss");
channel.setTitle("Article Feed");
channel.setDescription("Article Feed Description");
channel.setPubDate(new Date());
return channel;
}
use of com.rometools.rome.feed.rss.Channel in project tutorials by eugenp.
the class ArticleFeedView method newFeed.
protected Channel newFeed() {
Channel channel = new Channel("rss_2.0");
channel.setLink("http://localhost:8080/spring-mvc-simple/rss");
channel.setTitle("Article Feed");
channel.setDescription("Article Feed Description");
channel.setPubDate(new Date());
return channel;
}
use of com.rometools.rome.feed.rss.Channel in project spring-mvc-showcase by spring-projects.
the class MessageConvertersController method writeChannel.
@GetMapping("/rss")
public Channel writeChannel() {
Channel channel = new Channel();
channel.setFeedType("rss_2.0");
channel.setTitle("My RSS feed");
channel.setDescription("Description");
channel.setLink("http://localhost:8080/mvc-showcase/rss");
return channel;
}
use of com.rometools.rome.feed.rss.Channel in project spring-framework by spring-projects.
the class RssChannelHttpMessageConverterTests method writeOtherContentTypeParameters.
@Test
public void writeOtherContentTypeParameters() throws IOException {
Channel channel = new Channel("rss_2.0");
channel.setTitle("title");
channel.setLink("https://example.com");
channel.setDescription("description");
MockHttpOutputMessage message = new MockHttpOutputMessage();
converter.write(channel, new MediaType("application", "rss+xml", singletonMap("x", "y")), message);
assertThat(message.getHeaders().getContentType().getParameters()).as("Invalid content-type").hasSize(2).containsEntry("x", "y").containsEntry("charset", "UTF-8");
}
use of com.rometools.rome.feed.rss.Channel in project spring-framework by spring-projects.
the class RssChannelHttpMessageConverterTests method writeOtherCharset.
@Test
public void writeOtherCharset() throws IOException {
Channel channel = new Channel("rss_2.0");
channel.setTitle("title");
channel.setLink("https://example.com");
channel.setDescription("description");
String encoding = "ISO-8859-1";
channel.setEncoding(encoding);
Item item1 = new Item();
item1.setTitle("title1");
MockHttpOutputMessage outputMessage = new MockHttpOutputMessage();
converter.write(channel, null, outputMessage);
assertThat(outputMessage.getHeaders().getContentType()).as("Invalid content-type").isEqualTo(new MediaType("application", "rss+xml", Charset.forName(encoding)));
}
Aggregations