protected File generateScorecardName(ArchiveMetadata archive, File reportDirectory) { Validate.notNull(archive, "Archive is required, but null."); Validate.notNull(reportDirectory, "Report directory is required, but null."); String scorecardName = "scorecard-" + StringUtils.replace(archive.getName(), ".", "-") + ".xlsx"; String outputName = reportDirectory.getAbsolutePath() + File.separator + scorecardName; File output = new File(outputName); return output; }
protected void generateReport(ArchiveMetadata archive, File reportDirectory) { if (archive.getName() == null) { LOG.info("Processing reports for: " + archive.getFilePointer().toString()); } else { LOG.info("Processing reports for: "+archive.getName()); } if( this.reporters != null ) { for(Reporter reporter : this.reporters) { reporter.process(archive, reportDirectory); } } if( this.reporters == null || this.reporters.size() == 0 ){ LOG.warn("No reporters are currently registered."); } LOG.info("Reporting complete."); }
@Override public void processMeta(ManifestMetadata file) { // check to see if a version already exists. Only process if no version exists.. for (AbstractDecoration dr : file.getArchiveMeta().getDecorations()) { if (dr instanceof PomVersion) { LOG.debug("Already has version result: " + dr.toString()); return; } } // Otherwise look for default version information. String name = null; String version = extractValue(file.getManifest(), versionPriority); version = cleanseValue(version); if (version != null) { name = extractValue(file.getManifest(), namePriority); name = cleanseValue(name); // otherwise, guess the name from the archive name... // first, look for "-[0-9]" ane substring before that. if (StringUtils.isBlank(name)) { name = extractNameFromArchiveName(file.getArchiveMeta().getName()); } } if (StringUtils.isNotBlank(name) && StringUtils.isNotBlank(version)) { Version vr = new Version(); vr.setName(name); vr.setVersion(version); file.getArchiveMeta().getDecorations().add(vr); return; } }