Filipino HJUers Kai

Status
Not open for further replies.
guys pasingit lang ha:

for sale - IXA BELT
complete with all the accessories with some paint chipping on garuru and powered ixa fuestles.

PHP1500 nalang.

will bring it on toycon.

medyo naligaw sa payabangan ang thread ah....
 
guys pasingit lang ha:

for sale - IXA BELT
complete with all the accessories with some paint chipping on garuru and powered ixa fuestles.

PHP1500 nalang.

will bring it on toycon.

medyo naligaw sa payabangan ang thread ah....

Very tempting... But I think I'll pass on that. Great offer though. :thumbs:
 
Hmmm... Paastigan ba ng profession?

Not for the faint of heart...

[hide]
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;

import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

public class PomAnalysisDriver {

private static XPathFactory xpathFactory = XPathFactory.newInstance();

XPathExpression artifactIdExpr = null;

XPathExpression dependencyExpr = null;

XPathExpression depGroupIdExpr = null;

XPathExpression depArtifactIdExpr = null;

XPathExpression depVersionExpr = null;

public static void main(String[] args) throws Exception {
try {
List pomFiles = new ArrayList();

PomAnalysisDriver pad = new PomAnalysisDriver();
pad.init();
pad.searchForPomFiles("[ROOT_DIR]", pomFiles);
pad.execute(pomFiles);
} finally {
System.out.println("Done.");
}
}

public void init() throws XPathExpressionException {
XPath xpath = xpathFactory.newXPath();
artifactIdExpr = xpath.compile("/project/artifactId/text()");
dependencyExpr = xpath.compile("/project/dependencies/dependency");
depGroupIdExpr = xpath.compile("./groupId/text()");
depArtifactIdExpr = xpath.compile("./artifactId/text()");
depVersionExpr = xpath.compile("./version/text()");
}

public void searchForPomFiles(final String dir, final List pomFiles) {
File initialDir = new File(dir);
if (initialDir.isDirectory() == false) {
return;
} else {
String[] files = initialDir.list();
for (String filename : files) {
String suffix = "";
if (dir.endsWith("\\") == false && dir.endsWith("/") == false) {
suffix = "\\";
}
File childDir = new File(dir + suffix + filename);
if (childDir.isDirectory() == true) {
searchForPomFiles(dir + suffix + filename, pomFiles);
} else {
if (filename.equals("pom.xml")) {
pomFiles.add(childDir.getAbsolutePath());
}
}
}
}
}

public void execute(final List pomFiles) throws SAXException, IOException,
ParserConfigurationException, XPathExpressionException {
for (String pomFilename : pomFiles) {
File f = new File(pomFilename);
Document document;

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(f);

// Node projectNode = document.getDocumentElement();
// NodeList children = projectNode.getChildNodes();

String projectName = (String)artifactIdExpr.evaluate(document, XPathConstants.STRING);

List dependencies = new ArrayList();

NodeList nodes = (NodeList)dependencyExpr.evaluate(document, XPathConstants.NODESET);
for (int i = 0; i < nodes.getLength(); i++) {
Node dependency = nodes.item(i);
String depGroupId = (String) depGroupIdExpr.evaluate(dependency,
XPathConstants.STRING);
String depArtifactId = (String) depArtifactIdExpr.evaluate(dependency,
XPathConstants.STRING);
String depVersion = (String) depVersionExpr.evaluate(dependency,
XPathConstants.STRING);
String depId = "/" + depGroupId + "/" + depArtifactId + "/" +
depVersion + "/" + projectName;
dependencies.add(depId);
}

for (String s : dependencies) {
System.out.println(s);
}
}
}

}
[/hide]


Mushashi... Looks like you copied the code from the below link. So, why are you parsing porn.xml files?


http://affy.blogspot.com/2007/09/extracting-dependancy-lists-from-maven.html
 
Mushashi... Looks like you copied the code from the below link. So, why are you parsing porn.xml files?


http://affy.blogspot.com/2007/09/extracting-dependancy-lists-from-maven.html

Yep, it's a source site for tips on getting certain info especially on opensource systems like Apache Maven.

Confidential kasi ung mga codes ko sa office so I couldn't paste those, you know that.

But the main point was to show CA that even in our field (IT), people can also easily lose their minds.

dont worry pare hindi ito scam hehehehehe

Yes I know, I'm just passing it up since I don't get secondary Rider belts if I don't have the main Rider belt of that series, and since I'm not a fan of Kiva, I'll be resisting your great offer... :sweat:
 
Status
Not open for further replies.

Latest News & Videos

Latest News

Back
Top