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 fileMeta) { Document document = fileMeta.getParsedDocument(); if (document == null) { if (LOG.isDebugEnabled()) { LOG.debug("Document was null. Problem parsing: " + fileMeta.getFilePointer().getAbsolutePath()); } // attach the bad file so we see it in the reports... fileMeta.getArchiveMeta().getEntries().add(fileMeta); return; } super.processMeta(fileMeta); }
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); } }
@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); } }