INNER CODE UNIT · Java
load
temporalio/sdk-java · temporal-envconfig/src/main/java/io/temporal/envconfig/ClientConfig.java:95
public static ClientConfig load(LoadClientConfigOptions options) throws IOException {
ObjectReader reader = new TomlMapper().readerFor(ClientConfigToml.TomlClientConfig.class);
if (options.isStrictConfigFile()) {
reader =
reader.withFeatures(
com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
} else {
reader =
reader.withoutFeatures(
com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
}
if (options.getConfigFileData() != null && options.getConfigFileData().length > 0) {
if (options.getConfigFilePath() != null && !options.getConfigFilePath().isEmpty()) {
throw new IllegalArgumentException(
"Cannot have both ConfigFileData and ConfigFilePath set");
}
ClientConfigToml.TomlClientConfig result = reader.readValue(options.getConfigFileData());
return new ClientConfig(ClientConfigToml.getClientProfiles(result));