in src/main/java/com/ericsson/gerrit/plugins/heartbeat/HeartbeatConfig.java [51:67]
private void load(File configPath) throws ConfigInvalidException, IOException {
FileBasedConfig cfg = new FileBasedConfig(configPath, FS.DETECTED);
if (!cfg.getFile().exists() || cfg.getFile().length() == 0) {
logger.atFine().log("No %s or empty; using all default values", cfg.getFile());
return;
}
try {
cfg.load();
} catch (ConfigInvalidException e) {
throw new ConfigInvalidException(
String.format("Config file %s is invalid: %s", cfg.getFile(), e.getMessage()), e);
} catch (IOException e) {
throw new IOException(String.format("Cannot read %s: %s", cfg.getFile(), e.getMessage()), e);
}
delay = cfg.getInt(HEARTBEAT_SECTION, DELAY_KEY, DEFAULT_DELAY);
}