/**
  * Get the tools out of the root element
  *
  * @param root
  * @return
  */
 public static XMLElement getToolsXML() {
   XMLElement root = getSettingsXMLRoot();
   Vector<XMLElement> children = root.getChildren();
   for (XMLElement curElement : children) {
     if (curElement.getName().equalsIgnoreCase("TOOLS")) {
       return curElement;
     }
   }
   return null;
 }
  public HadoopInputDirGenerator(String propFileName, int noDataSet, boolean debug)
      throws Exception {
    this.propFileName = propFileName;
    this.debug = debug;

    Properties properties = new Properties();
    try {
      properties.load(new FileInputStream(this.propFileName));

    } catch (FileNotFoundException e) {
      // TODO Auto-generated catch block
      System.out.println("here");
      e.printStackTrace();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      System.out.println("here2");
      e.printStackTrace();
    }

    XMLParser xmlParser = new XMLParser();
    // Getting the path of the Dataset
    String graphsPath = properties.getProperty("path");
    // parsing the test set
    String testGraphsListPath = properties.getProperty("source");
    // parsing the training set
    String trainingGraphsListPath = properties.getProperty("target");

    XMLElement testXML = new XMLElement();
    FileReader testReader = new FileReader(testGraphsListPath);
    testXML.parseFromReader(testReader);
    Vector testListchildren = testXML.getChildren();
    XMLElement testRoot = (XMLElement) testListchildren.get(0);
    Enumeration testEnumerator = testRoot.enumerateChildren();
    String testGraphFileName = "";
    String testGraphClass = "";

    XMLElement trainingXML = new XMLElement();
    FileReader trainingReader = new FileReader(trainingGraphsListPath);
    trainingXML.parseFromReader(trainingReader);
    Vector trainingListchildren = trainingXML.getChildren();
    XMLElement trainingRoot = (XMLElement) trainingListchildren.get(0);

    String trainingGraphFileName = "";
    String trainingGraphClass = "";
    // Preparing the txt file ...
    PrintStream ps;

    File theDir = new File(properties.getProperty("path") + "inputs");

    // if the directory does not exist, create it
    if (!theDir.exists()) {
      System.out.println("creating directory: ");
      boolean result = theDir.mkdir();
      if (result) {
        System.out.println("DIR created");
      }
    }

    while (testEnumerator.hasMoreElements()) {
      XMLElement testChild = (XMLElement) testEnumerator.nextElement();
      testGraphFileName = (String) testChild.getAttribute("file", null);
      testGraphClass = (String) testChild.getAttribute("class", "NO_CLASS");
      Enumeration trainingEnumerator = trainingRoot.enumerateChildren();

      while (trainingEnumerator.hasMoreElements()) {
        XMLElement trainingChild = (XMLElement) trainingEnumerator.nextElement();
        trainingGraphFileName = (String) trainingChild.getAttribute("file", null);
        trainingGraphClass = (String) trainingChild.getAttribute("class", "NO_CLASS");
        ps =
            new PrintStream(
                properties.getProperty("path")
                    + "inputs/"
                    + testGraphFileName
                    + "-"
                    + trainingGraphFileName
                    + ".txt");
        System.out.println(
            noDataSet
                + "	"
                + testGraphFileName
                + "	"
                + trainingGraphFileName
                + "	"
                + testGraphClass
                + "	"
                + trainingGraphClass);
        ps.println(
            noDataSet
                + "	"
                + testGraphFileName
                + "	"
                + trainingGraphFileName
                + "	"
                + testGraphClass
                + "	"
                + trainingGraphClass);
        ps.close();
      }
    }
  }