Package fi.luomus.commons.config

Examples of fi.luomus.commons.config.ConfigReader


  public void init(ServletConfig config) throws ServletException {
    super.init(config);
    try {
      String configFile = resolveConfigFile();
      System.out.println(this.getClass().getCanonicalName() + " being initialized using configfile " + configFile);
      this.config = new ConfigReader(configFile);
      if (this.config.developmentMode()) {
        this.errorReporter = new ErrorReporingToSystemErr();
      } else {
        this.errorReporter = new ErrorReporterViaEmail(this.config);
      }
View Full Code Here


        services.add(documentQueueService);
    }

    private void initConfigAndErrorReporter() throws ServletException {
    try {
      this.config = new ConfigReader(resolveConfigFile());
      if (this.config.developmentMode()) {
        this.errorReporter = new ErrorReporingToSystemErr();
      } else {
        this.errorReporter = new ErrorReporterViaEmail(this.config);
      }
View Full Code Here

    System.out.println(this.getClass() + " CLOSED DOWN ");
  }

  private void initConfigAndErrorReporter() throws ServletException {
    try {
      this.config = new ConfigReader(resolveConfigFile());
      if (this.config.developmentMode()) {
        this.errorReporter = new ErrorReporingToSystemErr();
      } else {
        this.errorReporter = new ErrorReporterViaEmail(this.config);
      }
View Full Code Here

      writer.write("DBusername = username");
      writer.newLine();
      writer.write("DBpassword = password");
      writer.newLine();
      writer.close();
      r = new ConfigReader(TEMP);
      if (r == null) fail("didn't open the file");
    }
View Full Code Here

      if (!f.delete()) throw new Exception("delete failed: ConfigReader blocks the file");
    }
   
    public void test_itFailsToOpenAFileThatDoesntExists() {
      try {
        new ConfigReader("thisfiledoesntexists");
      } catch (Exception e) {
        return;
      }
      fail("Didn't fail");
    }
View Full Code Here

    assert(laji.equals("HIPCARL"));
  }

  private static void configExample() {
    try {
      Config config = new ConfigReader("C:/myconfigfile.properties");
      String password = config.get(Config.DB_PASSWORD);
      String something = config.get("something");
    } catch (FileNotFoundException e) {
      // yep
    }
  }
View Full Code Here

public class TestConfig {
 
  public static Config getConfig()  {
    try {
      return new ConfigReader("C:/apache-tomcat/app-conf/pese_frameworktests.config");
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      return null;
    }
  }
View Full Code Here

  public void init(ServletConfig config) throws ServletException {
    super.init(config);
    try {
      String configFile = resolveConfigFile();
      System.out.println(this.getClass().getCanonicalName() + " being initialized using configfile " + configFile);
      this.config = new ConfigReader(configFile);
      if (this.config.developmentMode()) {
        this.errorReporter = new ErrorReporingToSystemErr();
      } else {
        this.errorReporter = new ErrorReporterViaEmail(this.config);
      }
View Full Code Here

TOP

Related Classes of fi.luomus.commons.config.ConfigReader

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.