final SyndEntry entry = new SyndEntryImpl(); entry.setPublishedDate(new Date()); // FIXME: item.getEventDate(); entry.setAuthor(getNexusAuthor()); entry.setLink("/");
public SyndFeed getFeed(final Integer from, final Integer count, final Map<String, String> params) throws IOException { final SyndFeedImpl feed = new SyndFeedImpl(); feed.setTitle(getTitle()); feed.setDescription(getDescription()); feed.setAuthor(getNexusAuthor()); feed.setPublishedDate(new Date()); final Iterable<String> logFilenamesToScan = getLogFilenamesToScan(params); // default same as org.sonatype.nexus.feeds.DefaultFeedRecorder.DEFAULT_PAGE_SIZE int remainingCount = count != null ? count : 40; final List<SyndEntry> entries = Lists.newArrayList(); for (String logFileName : logFilenamesToScan) { final File logFile = logManager.getLogFile(logFileName); if (logFile == null) { // not found the file. This is either as nexus.log does not exists // or not yet rolled over, so nexus.log.1 not found // In any case, we can stop safely, as either way // we have nothing to scan. Worst case is that we // run as WAR or user completely customized logging configuration. break; } final List<SyndEntry> logFileEntries = extractEntriesFromLogfile(logFile, remainingCount); remainingCount -= logFileEntries.size(); entries.addAll(logFileEntries); } feed.setEntries(entries); return feed; }