Package fr.eolya.simplepipeline.config

Examples of fr.eolya.simplepipeline.config.PipelineConfig


  private boolean once = false;
  private String witnessFilesPath = null;

  public static void main(String[] args) {

    PipelineConfig config;

    if (args.length == 0) {
      usage();
      System.exit(-1);
    }

    Getopt g = new Getopt("Indexer", args, "p:ov");
    g.setOpterr(false);
    int c;

    boolean once = false;
    boolean verbose = false;

    String xmlConfigFileName = "";

    while ((c = g.getopt()) != -1) {
      switch (c) {
      case 'p':
        xmlConfigFileName = g.getOptarg();
        break;

      case 'o':
        once = true;
        break;

      case 'v':
        verbose = true;
        break;
      }
    }

    if ("".equals(xmlConfigFileName)) {
      System.out.println("Error: no configuration file specified");
      System.exit(-1);
    }
    xmlConfigFileName = Utils.getValidPropertyPath(xmlConfigFileName, null, "HOME");

    System.out.println("Configuration file = " + xmlConfigFileName);
   
    try {
      File configFile =new File(xmlConfigFileName);
      if (!configFile.exists()) {
        System.out.println("Error configuration file not found [" + xmlConfigFileName + "]");
        System.exit(-1);
      }
    } catch (Exception e) {
      // e.printStackTrace();
      System.out.println("Error while reading configuration file");
      e.printStackTrace();
      System.exit(-1);
    }

    config = new PipelineConfig();
    try {
      config.loadFile(xmlConfigFileName);
    } catch (IOException e) {
      // e.printStackTrace();
      System.out.println("Error while reading configuration file");
      e.printStackTrace();
      System.exit(-1);
    }

    String witnessFilesPath = config.getProperty("/pipeline/param[@name='witnessfilespath']");
    witnessFilesPath = Utils.getValidPropertyPath(witnessFilesPath, null, "HOME");
    if (witnessFilesPath == null || "".equals(witnessFilesPath)) {
      System.out.println("Error : missing witness_files_path propertie");
      System.exit(-1);
    }
View Full Code Here

TOP

Related Classes of fr.eolya.simplepipeline.config.PipelineConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.