private String resolveCommitter() { final String key = "user.name"; Optional<String> name = command(ConfigGet.class).setName(key).call(); checkState(name.isPresent(), "%s not found in config. Use geogig config [--global] %s <your name> to configure it.", key, key); return name.get(); }
private String resolveCommitter() { if (committerName != null) { return committerName; } final String key = "user.name"; Optional<String> name = command(ConfigGet.class).setName(key).call(); checkState(name.isPresent(), "%s not found in config. Use geogig config [--global] %s <your name> to configure it.", key, key); return name.get(); }
private String resolveCommitter() { final String key = "user.name"; Optional<String> name = command(ConfigGet.class).setName(key).call(); checkState(name.isPresent(), "%s not found in config. Use geogig config [--global] %s <your name> to configure it.", key, key); return name.get(); }
@Nullable private String resolveCommitterEmail() { if (committerEmail != null) { return committerEmail.orNull(); } final String key = "user.email"; Optional<String> email = command(ConfigGet.class).setName(key).call(); checkState(email.isPresent(), "%s not found in config. Use geogig config [--global] %s <your email> to configure it.", key, key); return email.get(); }
private String resolveCommitterEmail() { final String key = "user.email"; Optional<String> email = command(ConfigGet.class).setName(key).call(); checkState(email.isPresent(), "%s not found in config. Use geogig config [--global] %s <your email> to configure it.", key, key); return email.get(); }
private boolean checkConsoleEnabled(Context ctx) { Optional<String> configOption = ctx.command(ConfigGet.class).setName("web.console.enabled") .call(); boolean enabled = configOption.isPresent() && Boolean.parseBoolean(configOption.get()); return enabled; }
private String resolveCommitterEmail() { final String key = "user.email"; Optional<String> email = command(ConfigGet.class).setName(key).call(); checkState(email.isPresent(), "%s not found in config. Use geogig config [--global] %s <your email> to configure it.", key, key); return email.get(); } }
private String resolveCommitter() { final String namekey = "user.name"; String name = getClientData(namekey, String.class) .or(command(ConfigGet.class).setName(namekey).call()).orNull(); checkState(name != null, "%s not found in config. Use geogig config [--global] %s <your name> to configure it.", namekey, namekey); return name; }
private String resolveCommitter() { if (committerName != null) { return committerName; } final String namekey = "user.name"; String name = getClientData(namekey, String.class) .or(command(ConfigGet.class).setName(namekey).call()).orNull(); checkState(name != null, "%s not found in config. Use geogig config [--global] %s <your name> to configure it.", namekey, namekey); return name; }
private String resolveCommitter() { final String namekey = "user.name"; String name = getClientData(namekey, String.class) .or(command(ConfigGet.class).setName(namekey).call()).orNull(); checkState(name != null, "%s not found in config. Use geogig config [--global] %s <your name> to configure it.", namekey, namekey); return name; }
@Nullable private String resolveCommitterEmail() { if (committerEmail != null) { return committerEmail.orNull(); } final String emailkey = "user.email"; String email = getClientData(emailkey, String.class) .or(command(ConfigGet.class).setName(emailkey).call()).orNull(); checkState(email != null, "%s not found in config. Use geogig config [--global] %s <your email> to configure it.", emailkey, emailkey); return email; }
private String resolveCommitterEmail() { final String emailkey = "user.email"; String email = getClientData(emailkey, String.class) .or(command(ConfigGet.class).setName(emailkey).call()).orNull(); checkState(email != null, "%s not found in config. Use geogig config [--global] %s <your email> to configure it.", emailkey, emailkey); return email; } }
private String resolveCommitterEmail() { final String emailkey = "user.email"; String email = getClientData(emailkey, String.class) .or(command(ConfigGet.class).setName(emailkey).call()).orNull(); checkState(email != null, "%s not found in config. Use geogig config [--global] %s <your email> to configure it.", emailkey, emailkey); return email; }
private int getOutputLimit(Context ctx) { final int defaultLimit = 1024 * 16; Optional<String> configuredLimit = ctx.command(ConfigGet.class).setName("web.console.limit") .call(); int limit = defaultLimit; if (configuredLimit.isPresent()) { try { limit = Integer.parseInt(configuredLimit.get()); } catch (NumberFormatException ignore) { // limit = defaultLimit; } if (limit < 1024) { limit = 1024; } } return limit; }
private int parsePushLimit(Repository local) { final String confKey = "push.chunk.limit"; Optional<String> configLimit = local.command(ConfigGet.class).setName(confKey).call(); int limit = DEFAULT_PUSH_BATCH_LIMIT; if (configLimit.isPresent()) { String climit = configLimit.get(); LOGGER.debug("Setting push batch limit to {} bytes as configured by {}", climit, confKey); try { int tmpLimit = Integer.parseInt(climit); if (tmpLimit < 1024) { LOGGER.warn("Value for push batch limit '{}' is set too low ({}). " + "A minimum of 1024 bytes is needed. Using the default value of {} bytes", confKey, tmpLimit, limit); } else { limit = tmpLimit; } } catch (NumberFormatException e) { LOGGER.warn("Invalid config value for {}, using the default of {} bytes", confKey, limit); } } else { LOGGER.info("No push batch limit set through {}, using the default of {} bytes", confKey, limit); } return limit; }
private RevPerson resolveTagger() { final String nameKey = "user.name"; final String emailKey = "user.email"; Optional<String> name = command(ConfigGet.class).setName(nameKey).call(); Optional<String> email = command(ConfigGet.class).setName(emailKey).call(); checkState(name.isPresent(), "%s not found in config. Use geogig config [--global] %s <your name> to configure it.", nameKey, nameKey); checkState(email.isPresent(), "%s not found in config. Use geogig config [--global] %s <your email> to configure it.", emailKey, emailKey); String taggerName = name.get(); String taggerEmail = email.get(); Platform platform = platform(); long taggerTimeStamp = platform.currentTimeMillis(); int taggerTimeZoneOffset = platform.timeZoneOffset(taggerTimeStamp); return RevPersonBuilder.build(taggerName, taggerEmail, taggerTimeStamp, taggerTimeZoneOffset); }
private RevPerson resolveTagger() { final String nameKey = "user.name"; final String emailKey = "user.email"; String taggerName = getClientData(nameKey, String.class) .or(command(ConfigGet.class).setName(nameKey).call()).orNull(); String taggerEmail = getClientData(emailKey, String.class) .or(command(ConfigGet.class).setName(emailKey).call()).orNull(); checkState(taggerName != null, "%s not found in config. Use geogig config [--global] %s <your name> to configure it.", nameKey, nameKey); checkState(taggerEmail != null, "%s not found in config. Use geogig config [--global] %s <your email> to configure it.", emailKey, emailKey); Platform platform = platform(); long taggerTimeStamp = platform.currentTimeMillis(); int taggerTimeZoneOffset = platform.timeZoneOffset(taggerTimeStamp); return RevPerson.builder().build(taggerName, taggerEmail, taggerTimeStamp, taggerTimeZoneOffset); }