public boolean canHandle(File artifact) { try { if (artifact.isFile() && artifact.getName().endsWith(".xml")) { Document doc = parse(artifact); String name = doc.getDocumentElement().getLocalName(); String uri = doc.getDocumentElement().getNamespaceURI(); if ("blueprint".equals(name) && "http://www.osgi.org/xmlns/blueprint/v1.0.0".equals(uri)) { return true; } } } catch (Exception e) { logger.error("Unable to parse deployed file " + artifact.getAbsolutePath(), e); } return false; }
@Override protected void doStart() throws Exception { Hashtable<String, Object> props = new Hashtable<>(); props.put("url.handler.protocol", "blueprint"); register(URLStreamHandlerService.class, new BlueprintURLHandler(), props); register(new Class[] { ArtifactUrlTransformer.class, ArtifactListener.class }, new BlueprintDeploymentListener()); }
@Override protected void doStart() throws Exception { Hashtable<String, Object> props = new Hashtable<>(); props.put("url.handler.protocol", "blueprint"); register(URLStreamHandlerService.class, new BlueprintURLHandler(), props); register(new Class[] { ArtifactUrlTransformer.class, ArtifactListener.class }, new BlueprintDeploymentListener()); }
public boolean canHandle(File artifact) { try { if (artifact.isFile() && artifact.getName().endsWith(".xml")) { Document doc = parse(artifact); String name = doc.getDocumentElement().getLocalName(); String uri = doc.getDocumentElement().getNamespaceURI(); if ("blueprint".equals(name) && "http://www.osgi.org/xmlns/blueprint/v1.0.0".equals(uri)) { return true; } } } catch (Exception e) { logger.error("Unable to parse deployed file " + artifact.getAbsolutePath(), e); } return false; }