Examples of ConfigReader


Examples of anvil.server.ConfigReader

   
      Server server;

      String configFile = System.getProperty("anvil.configFile");
      if (configFile != null) {
        ConfigReader reader = new ConfigReader(null, new File(configFile));
        server = reader.parse();
      } else {
        server = new Server(null);
        CompilerPreferences compiler = new CompilerPreferences(server);
        compiler.setUseTimestamp(false);
        compiler.setStoreImages(false);
View Full Code Here

Examples of anvil.server.ConfigReader

      usage();
    }
   
    try {
   
      _server = new ConfigReader(null, new File(config)).parse()
      reconfigure(_server);
     
      Log.log().setSeverity(verbose ? Log.DEBUG : Log.ERROR);
     
      CompilerPreferences prefs = new CompilerPreferences(_server);
View Full Code Here

Examples of com.clarkparsia.empire.config.io.ConfigReader

  public static EmpireConfiguration readConfiguration() {
    InputStream aConfigStream = null;

    // the default configuration reader
    ConfigReader aReader = new PropertiesConfigReader();

    try {
      // not ideal, really we want just a single standard config file name with the system property which can override
      // that.  but since we don't have a standard yet, we'll check a bunch of them.
      if (System.getProperty("empire.configuration.file") != null && new File(System.getProperty("empire.configuration.file")).exists()) {
        aConfigStream = new FileInputStream(System.getProperty("empire.configuration.file"));
      }
      // check inside the jar to see if the config file is there
      else if (DefaultEmpireModule.class.getResourceAsStream("/empire.configuration") != null) {
        aConfigStream = DefaultEmpireModule.class.getResourceAsStream("/empire.configuration");
      }
      // this is the default non-jar location
      else if (new File("empire.configuration").exists()) {
        aConfigStream = new FileInputStream("empire.configuration");
        aReader = new PropertiesConfigReader();
      }

      // these locations are @deprecated in 0.7, to be removed in 0.9
      else if (new File("empire.config").exists()) {
        aConfigStream = new FileInputStream("empire.config");
        aReader = new PropertiesConfigReader();
      }
      else if (new File("empire.properties").exists()) {
        aConfigStream = new FileInputStream("empire.properties");
        aReader = new PropertiesConfigReader();
      }
      else if (new File("empire.config.properties").exists()) {
        aConfigStream = new FileInputStream("empire.config.properties");
        aReader = new PropertiesConfigReader();
      }
      else if (new File("empire.xml").exists()) {
        aConfigStream = new FileInputStream("empire.xml");
        aReader = new XmlConfigReader();
      }
      else if (new File("empire.config.xml").exists()) {
        aConfigStream = new FileInputStream("empire.config.xml");
        aReader = new XmlConfigReader();
      }
    }
    catch (FileNotFoundException e) {
      LOGGER.error("Count not find config file: " + e.getMessage());
    }

    EmpireConfiguration aConfig = null;

    if (aConfigStream == null) {
      LOGGER.warn("No configuration found or specified, Empire may not start or function correctly.");
      return null;
    }
    else {
      // TODO: need a more sophisticated method of selection which reader to use =)
      if (System.getProperty("empire.config.reader") != null) {
        try {
          @SuppressWarnings("unchecked") // it's ok if this throws a cast exception, we handle that
          Class<ConfigReader> aClass = (Class<ConfigReader>) BeanReflectUtil.loadClass(System.getProperty("empire.config.reader"));

          aReader =  Empire.get().instance(aClass);
        }
        catch (Exception e) {
          LOGGER.error("Unable to find or create specified configuration reader class: " + System.getProperty("empire.config.reader"), e);
        }
      }
    }

    if (aConfigStream != null && aReader != null) {
      try {
        aConfig = aReader.read(aConfigStream);
      }
      catch (IOException e) {
        LOGGER.error("Error while reading default Empire configuration file from the path", e);
      }
      catch (EmpireException e) {
View Full Code Here

Examples of com.deafgoat.ml.prognosticator.ConfigReader

    /**
     * This runs the training and analysis.
     */
    public static void main(final String[] pArgs) throws Exception {

        final ConfigReader config = new ConfigReader(CONFIG_FILE);

        final ARFFWriter testArffWriter = new ARFFWriter(config, TEST_CSV, TEST_ARFF);
        testArffWriter.writeARFF();

        final ARFFWriter trainingArffWriter = new ARFFWriter(config, TRAINING_CSV, TRAINING_ARFF);
View Full Code Here

Examples of com.sun.tools.internal.jxc.ConfigReader

                        errorListener.error(null,Messages.NON_EXISTENT_FILE.format());
                        continue;
                    }

                    try {
                        ConfigReader configReader = new ConfigReader(env,env.getTypeDeclarations(),configFile,errorListener);

                        Collection<Reference> classesToBeIncluded = configReader.getClassesToBeIncluded();
                        J2SJAXBModel model = XJC.createJavaCompiler().bind(
                                classesToBeIncluded,Collections.<QName,Reference>emptyMap(),null,env);

                        SchemaOutputResolver schemaOutputResolver = configReader.getSchemaOutputResolver();

                        model.generateSchema(schemaOutputResolver,errorListener);
                    } catch (IOException e) {
                        errorListener.error(e.getMessage(),e);
                    } catch (SAXException e) {
View Full Code Here

Examples of com.sun.tools.internal.jxc.ConfigReader

                        errorListener.error(null,Messages.NON_EXISTENT_FILE.format());
                        continue;
                    }

                    try {
                        ConfigReader configReader = new ConfigReader(env,env.getTypeDeclarations(),configFile,errorListener);

                        Collection<Reference> classesToBeIncluded = configReader.getClassesToBeIncluded();
                        J2SJAXBModel model = XJC.createJavaCompiler().bind(
                                classesToBeIncluded,Collections.<QName,Reference>emptyMap(),null,env);

                        SchemaOutputResolver schemaOutputResolver = configReader.getSchemaOutputResolver();

                        model.generateSchema(schemaOutputResolver,errorListener);
                    } catch (IOException e) {
                        errorListener.error(e.getMessage(),e);
                    } catch (SAXException e) {
View Full Code Here

Examples of com.sun.tools.jxc.ConfigReader

                        errorListener.error(null,Messages.NON_EXISTENT_FILE.format());
                        continue;
                    }

                    try {
                        ConfigReader configReader = new ConfigReader(env,env.getTypeDeclarations(),configFile,errorListener);

                        Collection<Reference> classesToBeIncluded = configReader.getClassesToBeIncluded();
                        J2SJAXBModel model = XJC.createJavaCompiler().bind(
                                classesToBeIncluded,Collections.<QName,Reference>emptyMap(),null,env);

                        SchemaOutputResolver schemaOutputResolver = configReader.getSchemaOutputResolver();

                        model.generateSchema(schemaOutputResolver,errorListener);
                    } catch (IOException e) {
                        errorListener.error(e.getMessage(),e);
                    } catch (SAXException e) {
View Full Code Here

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

Examples of fi.luomus.commons.config.ConfigReader

        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

Examples of fi.luomus.commons.config.ConfigReader

    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
TOP
Copyright © 2018 www.massapi.com. 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.