@SuppressWarnings("unchecked")
  public String getFeedContent(Feed feed) {
    if (feed == null) {
      LOGGER.warning("Feed is unknown!");
      return null;
    }

    Date updated = new Date(System.currentTimeMillis());
    feed.setUpdated(updated);
    List<Module> modules = feed.getModules();
    if (!ListUtil.isEmpty(modules)) {
      for (Module module : modules) {
        if (module instanceof DCModule) {
          ((DCModule) module).setDate(updated);
        }
      }
    }

    try {
      return wfo.outputString(feed);
    } catch (Exception e) {
      LOGGER.log(Level.WARNING, "Error while outputing feed to string: " + feed, e);
      return null;
    }
  }
Example #2
0
  public void outputFeed(WireFeed feed) {
    try {
      System.out.println(feed.getFeedType());
      System.out.println(output.outputString(feed));
    } catch (FeedException e) {

    }
  }