@Test public void canHandleBpmnFile() { File file = new File("src/test/resources/testprocess.bpmn"); boolean canHandle = listener.canHandle(file); assertThat(canHandle, is(true)); }
@Override public boolean canHandle(File artifact) { try { String artifactName = artifact.getName(); if (artifact.isFile() && (artifactName.endsWith(".xml") || artifactName.endsWith(".bpmn"))) { Document doc = parse(artifact); String name = doc.getDocumentElement().getLocalName(); String uri = doc.getDocumentElement().getNamespaceURI(); if ("definitions".equals(name) && "http: return true; } } } catch (Exception e) { LOGGER.log(Level.SEVERE, "Unable to parse deployed file " + artifact.getAbsolutePath(), e); } return false; }
BpmnDeploymentListener implements ArtifactUrlTransformer { @Override public boolean canHandle(File artifact) { try { String artifactName = artifact.getName(); if (artifact.isFile() && (artifactName.endsWith(".xml") || artifactName.endsWith(".bpmn"))) { Document doc = parse(artifact); String name = doc.getDocumentElement().getLocalName(); String uri = doc.getDocumentElement().getNamespaceURI(); if ("definitions".equals(name) && "http: return true; } } } catch (Exception e) { LOGGER.log(Level.SEVERE, "Unable to parse deployed file " + artifact.getAbsolutePath(), e); } return false; } }
BpmnDeploymentListener implements ArtifactUrlTransformer { @Override public boolean canHandle(File artifact) { try { String artifactName = artifact.getName(); if (artifact.isFile() && (artifactName.endsWith(".xml") || artifactName.endsWith(".bpmn"))) { Document doc = parse(artifact); String name = doc.getDocumentElement().getLocalName(); String uri = doc.getDocumentElement().getNamespaceURI(); if ("definitions".equals(name) && "http: return true; } } } catch (Exception e) { LOGGER.log(Level.SEVERE, "Unable to parse deployed file " + artifact.getAbsolutePath(), e); } return false; }  }
BpmnDeploymentListener implements ArtifactUrlTransformer { @Override public boolean canHandle(File artifact) { try { String artifactName = artifact.getName(); if (artifact.isFile() && (artifactName.endsWith(".xml") || artifactName.endsWith(".bpmn"))) { Document doc = parse(artifact); String name = doc.getDocumentElement().getLocalName(); String uri = doc.getDocumentElement().getNamespaceURI(); if ("definitions".equals(name) && "http: return true; } } } catch (Exception e) { LOGGER.log(Level.SEVERE, "Unable to parse deployed file " + artifact.getAbsolutePath(), e); } return false; }  @Override boolean canHandle(File artifact); @Override URL transform(URL artifact); }
BpmnDeploymentListener implements ArtifactUrlTransformer { @Override public boolean canHandle(File artifact) { try { String artifactName = artifact.getName(); if (artifact.isFile() && (artifactName.endsWith(".xml") || artifactName.endsWith(".bpmn"))) { Document doc = parse(artifact); String name = doc.getDocumentElement().getLocalName(); String uri = doc.getDocumentElement().getNamespaceURI(); if ("definitions".equals(name) && "http: return true; } } } catch (Exception e) { LOGGER.log(Level.SEVERE, "Unable to parse deployed file " + artifact.getAbsolutePath(), e); } return false; }  @Override boolean canHandle(File artifact); @Override URL transform(URL artifact);  }