/** * @return the feed we built as serialized XML string * @throws FeedException if feed error */ public String outputString() throws FeedException { SyndFeedOutput feedWriter = new SyndFeedOutput(); return feedWriter.outputString(feed); }
public static String export(SyndFeed feed) throws FeedException { feed.setEncoding(StringPool.UTF8); SyndFeedOutput output = new SyndFeedOutput(); try { return output.outputString(feed); } catch (IllegalDataException ide) { // LEP-4450 _regexpStrip(feed); return output.outputString(feed); } }
@ResponseBody @GetMapping("/feed.xml") public ResponseEntity<String> feed() { String feed = ""; try { feed = new SyndFeedOutput().outputString(getFeed()); } catch (Exception ex) { logger.error("Could not generate feed", ex); } return ResponseEntity.ok(). contentType(MediaType.APPLICATION_ATOM_XML). cacheControl(CacheControl.maxAge(1, TimeUnit.HOURS)). eTag(Utils.md5(feed)). body(feed); }