use of com.rometools.rome.io.SyndFeedOutput in project asterixdb by apache.
the class RSSFeedServlet method get.
@Override
protected void get(IServletRequest req, IServletResponse res) throws IOException {
try {
SyndFeed feed = getFeed(req);
String feedType = req.getParameter(FEED_TYPE);
feedType = (feedType != null) ? feedType : defaultFeedType;
feed.setFeedType(feedType);
HttpUtil.setContentType(res, MIME_TYPE);
SyndFeedOutput output = new SyndFeedOutput();
output.output(feed, res.writer());
} catch (FeedException | ParseException ex) {
GlobalConfig.ASTERIX_LOGGER.log(Level.WARNING, ex.getMessage(), ex);
String msg = COULD_NOT_GENERATE_FEED_ERROR;
res.writer().print(msg);
res.setStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
}
}
Aggregations