@Override protected boolean continueProcessing(XmlMetadata meta) { if (meta.getParsedDocument() == null) { LOG.warn("Skipping XPathClassifyingDecorator; no parsed doc: " + meta.getFilePointer().getAbsolutePath()); return false; } try { final Boolean nodes = (Boolean) expression.evaluate(meta.getParsedDocument(), XPathConstants.BOOLEAN); if (nodes != null) { if (LOG.isDebugEnabled()) { LOG.debug("Returning: " + nodes.booleanValue() + " for XPath: " + xpathExpression + " on file: " + meta.getFilePointer().getAbsolutePath()); } return nodes.booleanValue(); } } catch (Exception e) { LOG.error("Exception running xpath.", e); } return false; } }
@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); }
@Override public void processMeta(final XmlMetadata meta) { if (meta.getParsedDocument() == null) { LOG.warn("Skipping XPathClassifyingDecorator: " + meta.getFilePointer().getAbsolutePath() + " because the document is unparsed."); return; LOG.debug("Found results for: " + meta.getFilePointer().getAbsolutePath());
@Override public void processMeta(final XmlMetadata meta) { if (meta.getParsedDocument() == null) { LOG.warn("Skipping XPathClassifyingDecorator: " + meta.getFilePointer().getAbsolutePath() + " because the document is unparsed."); return; LOG.debug("Found results for: " + meta.getFilePointer().getAbsolutePath());
@Override public void processMeta(XmlMetadata file) { String relativeDirectory = StringUtils.substringBeforeLast(file.getFilePointer().getAbsolutePath(), File.separator); String fileName = StringUtils.substringAfterLast(file.getFilePointer().getAbsolutePath(), File.separator); fileName = StringUtils.replace(fileName, ".", "-"); fileName = fileName + outputExtension; File relativeFile = new File(relativeDirectory + File.separator + fileName); Source xmlSource = new DOMSource(file.getParsedDocument()); Result xmlResult = new StreamResult(relativeFile); try { xsltTransformer.transform(xmlSource, xmlResult); Link linkResult = new Link(); linkResult.setDescription(outputDescription); linkResult.setLink(fileName); linkResult.setEffort(effort); if (LOG.isDebugEnabled()) { LOG.debug("Created link: " + ReflectionToStringBuilder.toString(linkResult)); } file.getDecorations().add(linkResult); } catch (TransformerException e) { LOG.error("Exception transforming XML.", e); } }
meta.getFilePointer().getAbsolutePath() + " because the document is unparsed."); return isProcessed; LOG.debug("Found results for: " + meta.getFilePointer().getAbsolutePath());
LOG.debug("GroupId not found for file: " + file.getFilePointer().getAbsolutePath() + "; trying parent groupId..."); LOG.debug("Parent groupId not found for file: " + file.getFilePointer().getAbsolutePath() + "; skipping."); return; LOG.debug("Version not found for file: " + file.getFilePointer().getAbsolutePath() + "; trying parent version..."); LOG.debug("Parent version not found for file: " + file.getFilePointer().getAbsolutePath() + "; skipping."); return; LOG.debug("ArtifactId not found for file: " + file.getFilePointer().getAbsolutePath()); return;
LOG.debug("Found results for: " + meta.getFilePointer().getAbsolutePath());