public static void main()

in webindex/modules/data/src/main/java/webindex/data/Configure.java [37:66]


  public static void main(String[] args) throws Exception {

    if (args.length != 2) {
      log.error("Usage: Configure <webindexConfigPath> <fluoAppProps>");
      System.exit(1);
    }
    WebIndexConfig webIndexConfig = WebIndexConfig.load(args[0]);
    String appPropsPath = args[1];
    Preconditions.checkArgument(new File(appPropsPath).exists(),
        "File does not exist: " + appPropsPath);

    FluoConfiguration fluoConfig =
        new FluoConfiguration(new File(webIndexConfig.getConnPropsPath()));
    fluoConfig.load(new File(appPropsPath));


    IndexEnv env = new IndexEnv(webIndexConfig, fluoConfig);
    env.initAccumuloIndexTable();

    FluoConfiguration appConfig = new FluoConfiguration();
    env.configureApplication(fluoConfig, appConfig);
    Iterator<String> iter = appConfig.getKeys();
    try (
        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(appPropsPath, true)))) {
      while (iter.hasNext()) {
        String key = iter.next();
        out.println(key + " = " + appConfig.getRawString(key));
      }
    }
  }