protected void createSummaryMeta(final XmlMetadata meta, String description, String match) { Summary result = new Summary(); result.setDescription(description); result.setPattern(match); result.setEffort(effort); for (ResultProcessor hint : hints) { hint.process(result); } meta.getDecorations().add(result); }
public void processMeta(FileMetadata file) { Summary gr = new Summary(); gr.setDescription(description); gr.setEffort(effort); file.getDecorations().add(gr); } }
@Override public XmlMetadata archiveEntryToMeta(ZipEntryMetadata archiveEntry) { File file = archiveEntry.getFilePointer(); LOG.debug("Processing XML: " + file.getAbsolutePath()); FileMetadata meta = null; if (file.length() > 1048576L * 1) { LOG.warn("XML larger than 1 MB: " + file.getAbsolutePath() + "; Skipping processing."); meta = new FileMetadata(); meta.setArchiveMeta(archiveEntry.getArchiveMeta()); meta.setFilePointer(file); Summary sr = new Summary(); sr.setDescription("File is too large; skipped."); sr.setLevel(NotificationLevel.WARNING); meta.getDecorations().add(sr); } else { XmlMetadata xmlMeta = new XmlMetadata(); xmlMeta.setArchiveMeta(archiveEntry.getArchiveMeta()); xmlMeta.setFilePointer(file); meta = xmlMeta; return xmlMeta; } return null; }
@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); } }
summary = ((Summary) dr).getDescription();
meta.setArchiveMeta(entry.getArchiveMeta()); Summary sr = new Summary(); sr.setDescription("File is too large; skipped."); sr.setLevel(NotificationLevel.WARNING); meta.getDecorations().add(sr);
@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; } }