protected boolean buildVendorResult(ArchiveMetadata meta) { for (AbstractDecoration result : meta.getDecorations()) { if (result instanceof VendorResult) { return true; } } return false; }
protected boolean isActive(XmlMetadata file) { for (AbstractDecoration dr : file.getArchiveMeta().getDecorations()) { if (dr instanceof PomVersion) { LOG.debug("Already has version result: " + dr.toString()); return false; } } return true; }
@Override public void processMeta(XmlMetadata file) { Document doc = file.getParsedDocument(); try { String description = extractStringValue(xPath, doc); if (StringUtils.isNotBlank(description)) { Summary result = new Summary(); result.setDescription(description); // add the link to the archive. file.getArchiveMeta().getDecorations().add(result); } } catch (XPathExpressionException e) { LOG.error("Exception running xpath expression.", e); } }
@Override public void processMeta(XmlMetadata file) { Document doc = file.getParsedDocument(); try { String link = extractStringValue(linkXPath, doc); if (StringUtils.isNotBlank(link)) { Link result = new Link(); result.setLink(link); result.setDescription("Project Site"); // add the link to the archive. file.getArchiveMeta().getDecorations().add(result); } } catch (XPathExpressionException e) { LOG.error("Exception running xpath expression.", e); } }
@Override public void processMeta(ManifestMetadata file) { // Look for default description information. String description = extractValue(file.getManifest(), descriptionPriority); if (description == null) { return; } // if it exists, cleanse it. description = cleanseValue(description); if (StringUtils.isNotBlank(description)) { Summary vr = new Summary(); vr.setDescription(description); file.getArchiveMeta().getDecorations().add(vr); return; } }
@Override public void processMeta(ManifestMetadata file) { // Look for default description information. String link = extractValue(file.getManifest(), linkPriority); if (link == null) { return; } // if it exists, cleanse it. link = cleanseValue(link); if (StringUtils.isNotBlank(link)) { Link vr = new Link(); vr.setDescription("Project Site"); vr.setLink(link); file.getArchiveMeta().getDecorations().add(vr); return; } }
@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; } }
protected void createVersionResult(XmlMetadata file, String groupId, String artifactId, String versionId, String name) { PomVersion vr = new PomVersion(); // default to artifact ID if name isn't provided. if (StringUtils.isBlank(name)) { name = artifactId; } vr.setName(name); vr.setVersion(versionId); vr.setArchetypeId(artifactId); vr.setGroupId(groupId); file.getArchiveMeta().getDecorations().add(vr); if(file.getArchiveMeta() instanceof ZipMetadata) { ZipMetadata zip = (ZipMetadata)file.getArchiveMeta(); knownArchiveProfiler.isKnownVendor(zip, groupId); } }
for (AbstractDecoration dr : result.getDecorations()) { if (dr instanceof Version)
@Override public void processMeta(ManifestMetadata file) { if (matchesAll(file.getManifest())) { Version vr = new Version(); if (StringUtils.isNotBlank(matchName)) { vr.setName(matchName); } else { String name = extractValue(file.getManifest(), namePriority); name = cleanseValue(name); vr.setName(name); } if (StringUtils.isNotBlank(matchVersion)) { vr.setVersion(matchVersion); } else { String version = extractValue(file.getManifest(), versionPriority); version = cleanseValue(version); vr.setVersion(version); } file.getArchiveMeta().getDecorations().add(vr); } }