public Artifact(URL url) throws Exception { if (url != null) { this.url = url; DocumentBuilder db = docFactory.newDocumentBuilder(); Document doc = db.parse(url.toString()); Node node = (Node) xpath.evaluate("/project", doc, XPathConstants.NODE); groupId = xpath.evaluate("groupId", node); artifactId = xpath.evaluate("artifactId", node); version = xpath.evaluate("version", node); type = xpath.evaluate("type", node); optional = (Boolean) xpath.evaluate("optinal", node, XPathConstants.BOOLEAN); String scope = xpath.evaluate("scope", node); if (scope != null && scope.length() > 0) { this.scope = Scope.valueOf(scope.toUpperCase()); } NodeList evaluate = (NodeList) xpath.evaluate("//dependencies/dependency", doc, XPathConstants.NODESET); for (int i = 0; i < evaluate.getLength(); i++) { Node childNode = evaluate.item(i); Artifact artifact = getArtifact(xpath.evaluate("groupId", childNode), xpath .evaluate("artifactId", childNode), xpath.evaluate("version", childNode)); add(artifact); } } }
public Artifact(URL url) throws Exception { if (url != null) { this.url = url; DocumentBuilder db = docFactory.newDocumentBuilder(); Document doc = db.parse(url.toString()); Node node = (Node) xpath.evaluate("/project", doc, XPathConstants.NODE); groupId = xpath.evaluate("groupId", node); artifactId = xpath.evaluate("artifactId", node); version = xpath.evaluate("version", node); type = xpath.evaluate("type", node); optional = (Boolean) xpath.evaluate("optinal", node, XPathConstants.BOOLEAN); String scope = xpath.evaluate("scope", node); if (scope != null && scope.length() > 0) { this.scope = Scope.valueOf(scope.toUpperCase()); } NodeList evaluate = (NodeList) xpath.evaluate("//dependencies/dependency", doc, XPathConstants.NODESET); for (int i = 0; i < evaluate.getLength(); i++) { Node childNode = evaluate.item(i); Artifact artifact = getArtifact(xpath.evaluate("groupId", childNode), xpath.evaluate("artifactId", childNode), xpath.evaluate("version", childNode)); add(artifact); } } }
public Artifact(URL url) throws Exception { if (url != null) { this.url = url; DocumentBuilder db = docFactory.newDocumentBuilder(); Document doc = db.parse(url.toString()); Node node = (Node) xpath.evaluate("/project", doc, XPathConstants.NODE); groupId = xpath.evaluate("groupId", node); artifactId = xpath.evaluate("artifactId", node); version = xpath.evaluate("version", node); type = xpath.evaluate("type", node); optional = (Boolean) xpath.evaluate("optinal", node, XPathConstants.BOOLEAN); String scope = xpath.evaluate("scope", node); if (scope != null && scope.length() > 0) { this.scope = Scope.valueOf(scope.toUpperCase()); } NodeList evaluate = (NodeList) xpath.evaluate("//dependencies/dependency", doc, XPathConstants.NODESET); for (int i = 0; i < evaluate.getLength(); i++) { Node childNode = evaluate.item(i); Artifact artifact = getArtifact(xpath.evaluate("groupId", childNode), xpath.evaluate("artifactId", childNode), xpath.evaluate("version", childNode)); add(artifact); } } }
public Artifact(URL url) throws Exception { if (url != null) { this.url = url; DocumentBuilder db = docFactory.newDocumentBuilder(); Document doc = db.parse(url.toString()); Node node = (Node) xpath.evaluate("/project", doc, XPathConstants.NODE); groupId = xpath.evaluate("groupId", node); artifactId = xpath.evaluate("artifactId", node); version = xpath.evaluate("version", node); type = xpath.evaluate("type", node); optional = (Boolean) xpath.evaluate("optinal", node, XPathConstants.BOOLEAN); String scope = xpath.evaluate("scope", node); if (scope != null && scope.length() > 0) { this.scope = Scope.valueOf(scope.toUpperCase()); } NodeList evaluate = (NodeList) xpath.evaluate("//dependencies/dependency", doc, XPathConstants.NODESET); for (int i = 0; i < evaluate.getLength(); i++) { Node childNode = evaluate.item(i); Artifact artifact = getArtifact(xpath.evaluate("groupId", childNode), xpath.evaluate("artifactId", childNode), xpath.evaluate("version", childNode)); add(artifact); } } }
public Artifact(URL url) throws Exception { if (url != null) { this.url = url; DocumentBuilder db = docFactory.newDocumentBuilder(); Document doc = db.parse(url.toString()); Node node = (Node) xpath.evaluate("/project", doc, XPathConstants.NODE); groupId = xpath.evaluate("groupId", node); artifactId = xpath.evaluate("artifactId", node); version = xpath.evaluate("version", node); type = xpath.evaluate("type", node); optional = (Boolean) xpath.evaluate("optinal", node, XPathConstants.BOOLEAN); String scope = xpath.evaluate("scope", node); if (scope != null && scope.length() > 0) { this.scope = Scope.valueOf(scope.toUpperCase()); } NodeList evaluate = (NodeList) xpath.evaluate("//dependencies/dependency", doc, XPathConstants.NODESET); for (int i = 0; i < evaluate.getLength(); i++) { Node childNode = evaluate.item(i); Artifact artifact = getArtifact(xpath.evaluate("groupId", childNode), xpath.evaluate("artifactId", childNode), xpath.evaluate("version", childNode)); add(artifact); } } }
public Artifact(URL url) throws Exception { if (url != null) { this.url = url; DocumentBuilder db = docFactory.newDocumentBuilder(); Document doc = db.parse(url.toString()); Node node = (Node) xpath.evaluate("/project", doc, XPathConstants.NODE); groupId = xpath.evaluate("groupId", node); artifactId = xpath.evaluate("artifactId", node); version = xpath.evaluate("version", node); type = xpath.evaluate("type", node); optional = (Boolean) xpath.evaluate("optinal", node, XPathConstants.BOOLEAN); String scope = xpath.evaluate("scope", node); if (scope != null && scope.length() > 0) { this.scope = Scope.valueOf(scope.toUpperCase()); } NodeList evaluate = (NodeList) xpath.evaluate("//dependencies/dependency", doc, XPathConstants.NODESET); for (int i = 0; i < evaluate.getLength(); i++) { Node childNode = evaluate.item(i); Artifact artifact = getArtifact(xpath.evaluate("groupId", childNode), xpath.evaluate("artifactId", childNode), xpath.evaluate("version", childNode)); add(artifact); } } }