コード例 #1
0
ファイル: SlacConfig.java プロジェクト: rlewczuk/slac
  private void setBaseProps() {
    if (!properties.containsKey("slac.log.dir")) {
      properties.setProperty(
          "slac.log.dir", SlacUtil.ensureDir(SlacUtil.path(homeDir, "log")).getPath());
    }

    if (!properties.containsKey("slac.data.dir")) {
      properties.setProperty(
          "slac.data.dir", SlacUtil.ensureDir(SlacUtil.path(homeDir, "data")).getPath());
    }

    if (!properties.containsKey("slac.conf.dir")) {
      properties.setProperty(
          "slac.conf.dir", SlacUtil.ensureDir(SlacUtil.path(homeDir, "conf")).getPath());
    }

    if (!properties.containsKey("slac.backup.dir")) {
      properties.setProperty("slac.backup.dir", SlacUtil.path(homeDir, "backup"));
    }

    if (!properties.containsKey("phantom.binary")) {
      for (String path :
          new String[] {
            SlacUtil.path(homeDir, "phantomjs"), "/usr/local/bin/phantomjs", "/usr/bin/phantomjs"
          }) {
        if (new File(path).canExecute()) {
          properties.setProperty("phantom.binary", path);
          break;
        }
      }
    }
  }
コード例 #2
0
ファイル: SlacConfig.java プロジェクト: rlewczuk/slac
  protected void loadProperties(String home, String fname, String defPath) {
    homeDir = home;
    properties = defaultProperties(defPath);
    String propPath = SlacUtil.path(homeDir, fname);
    loadCfg(properties, propPath, true);

    properties.put(PROP_HOME_DIR, homeDir);
  }
コード例 #3
0
ファイル: SlacConfig.java プロジェクト: rlewczuk/slac
 /**
  * Returns path to log directory.
  *
  * @return directory where agent will write its logs.
  */
 public String getLogDir() {
   return SlacUtil.path(homeDir, "log");
 }