Package org.molgenis.util.cmdline

Examples of org.molgenis.util.cmdline.CmdLineParser


    finally
    {
      IOUtils.closeQuietly(is);
    }

    CmdLineParser parser = new CmdLineParser(this);
    parser.parse(props);
    this.molgenis_properties = propertiesFile;

    // parse passwordfile
    String passwordFile = propertiesFile.replace(".properties", ".passwd");
    this.molgenis_passwd = passwordFile;
    props = new Properties();
    is = null;
    try
    {
      // try to load from local files
      is = new FileInputStream(passwordFile.trim());
      props.load(is);
    }
    catch (FileNotFoundException e)
    {
      InputStream is2 = ClassLoader.getSystemResourceAsStream(passwordFile.trim());
      try
      {
        // try to load from classpath
        props.load(is2);
      }
      catch (Exception e2)
      {
        // no biggie
      }
      finally
      {
        IOUtils.closeQuietly(is2);
      }
    }
    finally
    {
      IOUtils.closeQuietly(is);
    }
    parser = new CmdLineParser(this);
    parser.parse(props);

    // warn if no password was provided
    if ("".equals(this.db_password)) System.err.println("WARNING: db_password was not provided in neither "
        + propertiesFile + " nor " + passwordFile);
View Full Code Here


   * @throws FileNotFoundException
   * @throws CmdLineException
   */
  public MolgenisOptions(Properties properties)
  {
    CmdLineParser parser;
    try
    {
      parser = new CmdLineParser(this);
      parser.parse(properties);
      Logger.getLogger(this.getClass().getSimpleName()).debug("parsed properties file.");
    }
    catch (Exception e)
    {
      // TODO Auto-generated catch block
View Full Code Here

  @Override
  public String toString()
  {
    try
    {
      return new CmdLineParser(this).toString(this);
    }
    catch (NullPointerException e)
    {
      e.printStackTrace();
    }
View Full Code Here

TOP

Related Classes of org.molgenis.util.cmdline.CmdLineParser

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.