Create/load a HikariConfig from Hibernate properties.

@param props a map of Hibernate properties
@return a HikariConfig
540076
@SuppressWarnings("rawtypes")
   public static HikariConfig loadConfiguration(Map props)
   {
      Properties hikariProps = new Properties();
      copyProperty(AvailableSettings.ISOLATION, props, "transactionIsolation", hikariProps);
      copyProperty(AvailableSettings.AUTOCOMMIT, props, "autoCommit", hikariProps);
      copyProperty(AvailableSettings.DRIVER, props, "driverClassName", hikariProps);
      copyProperty(AvailableSettings.URL, props, "jdbcUrl", hikariProps);
      copyProperty(AvailableSettings.USER, props, "username", hikariProps);
      copyProperty(AvailableSettings.PASS, props, "password", hikariProps);

      for (Object keyo : props.keySet()) {
         String key = (String) keyo;
         if (key.startsWith(CONFIG_PREFIX)) {
            hikariProps.setProperty(key.substring(CONFIG_PREFIX.length()), (String) props.get(key));
         }
      }

      return new HikariConfig(hikariProps);
   }
721200
public ExecutorFactoryConfigurationBuilder withProperties(Properties props) {
      attributes.attribute(PROPERTIES).set(TypedProperties.toTypedProperties(props));
      return this;
   }
346074
public static void loadCustomerProperties(Properties props){
        for(Entry<Object, Object> entry : props.entrySet()){
            setProperty((String)entry.getKey(), entry.getValue());
        }
    }
887763
public DataBinder load(Properties props) {
        Enumeration<?> enumeration = props.propertyNames();
        while (enumeration.hasMoreElements()) {
            String key = (String)enumeration.nextElement();
            put(key, props.getProperty(key));
        }
        return this;
    }
38187
public static Props resolveProps(final Props props) {
    if (props == null) {
      return null;
    }

    final Props resolvedProps = new Props();

    final LinkedHashSet<String> visitedVariables = new LinkedHashSet<>();
    for (final String key : props.getKeySet()) {
      String value = props.get(key);
      if (value == null) {
        logger.warn("Null value in props for key '" + key + "'. Replacing with empty string.");
        value = "";
      }

      visitedVariables.add(key);
      final String replacedValue =
          resolveVariableReplacement(value, props, visitedVariables);
      visitedVariables.clear();

      resolvedProps.put(key, replacedValue);
    }

    for (final String key : resolvedProps.getKeySet()) {
      final String value = resolvedProps.get(key);
      final String expressedValue = resolveVariableExpression(value);
      resolvedProps.put(key, expressedValue);
    }

    return resolvedProps;
  }
1352380
protected Reader doCreateScript(Properties props) {
		BundleStringJsonifier bsj = new BundleStringJsonifier(props, addQuoteToMessageKey);
		String script = template.toString();
		String messages = bsj.serializeBundles().toString();
		script = script.replaceFirst("@namespace", RegexUtil.adaptReplacementToMatcher(namespace));
		script = script.replaceFirst("@messages", RegexUtil.adaptReplacementToMatcher(messages));

		return new StringReader(script);
	}
228006
public static Preset reloadConfiguration(String marketplace, Properties props) throws MnoConfigurationException {
		Preset preset = new Preset(marketplace, props);
		configurations.put(marketplace, preset);
		return preset;
	}
457209
public DataSource createDataSource(Properties props, String dataSourceID) throws SQLException {
        lock.readLock().lock();
        try {
            if (!isInitialized)
                try {
                    // Switch to write lock for lazy initialization
                    lock.readLock().unlock();
                    lock.writeLock().lock();

                    if (!isInitialized) {
                        if (!loadFromApp())
                            classloader = AdapterUtil.getClassLoaderWithPriv(sharedLib);
                        isInitialized = true;
                    }
                } finally {
                    // Downgrade to read lock for rest of method
                    lock.readLock().lock();
                    lock.writeLock().unlock();
                }

            String className = (String) properties.get(DataSource.class.getName());
            if (className == null) {
                String vendorPropertiesPID = props instanceof PropertyService ? ((PropertyService) props).getFactoryPID() : PropertyService.FACTORY_PID;
                className = JDBCDrivers.getDataSourceClassName(vendorPropertiesPID);
                if (className == null) {
                    className = JDBCDrivers.getDataSourceClassName(getClasspath(sharedLib, true));
                    if (className == null) {
                        Set<String> packagesSearched = new LinkedHashSet<String>();
                        SimpleEntry<Integer, String> dsEntry = JDBCDrivers.inferDataSourceClassFromDriver //
                                        (classloader, packagesSearched, JDBCDrivers.DATA_SOURCE);
                        className = dsEntry == null ? null : dsEntry.getValue();
                        if (className == null)
                            throw classNotFound(DataSource.class.getName(), packagesSearched, dataSourceID, null);
                    }
                }
            }

            return create(className, props, dataSourceID);
        } finally {
            lock.readLock().unlock();
        }
    }
620562
private Properties loadProperties() {

        props = new Properties();

        try {
            InputStream in = Version.class.getResourceAsStream("version.properties");
            props.load(in);
            in.close();
        } catch (Exception e) {
            throw new Error("Missing version.properties");
        }

        return props;
    }
1268904
public Data set(Iterable<Property> props) {
        return !Iterables.isEmpty(props)
               ? new Data(props)
               : this;
    }
804931
public KafkaClient setProducerProperties(Properties props) {
        if (props == null) {
            producerProperties = null;
        } else {
            producerProperties = new Properties();
            producerProperties.putAll(props);
        }
        return this;
    }
1284044
public static AzkabanDataSource getDataSource(final Props props) {
    final String databaseType = props.getString("database.type");

    AzkabanDataSource dataSource = null;
    if (databaseType.equals("mysql")) {
      final int port = props.getInt("mysql.port");
      final String host = props.getString("mysql.host");
      final String database = props.getString("mysql.database");
      final String user = props.getString("mysql.user");
      final String password = props.getString("mysql.password");
      final int numConnections = props.getInt("mysql.numconnections");

      dataSource =
          getMySQLDataSource(host, port, database, user, password,
              numConnections);
    } else if (databaseType.equals("h2")) {
      final String path = props.getString("h2.path");
      final Path h2DbPath = Paths.get(path).toAbsolutePath();
      logger.info("h2 DB path: " + h2DbPath);
      dataSource = getH2DataSource(h2DbPath);
    }

    return dataSource;
  }
584760
@SneakyThrows
    public AmazonDynamoDB createAmazonDynamoDb(final AbstractDynamoDbProperties props) {
        if (props.isLocalInstance()) {
            LOGGER.debug("Creating DynamoDb standard client with endpoint [{}] and region [{}]",
                props.getEndpoint(), props.getRegion());
            val endpoint = new AwsClientBuilder.EndpointConfiguration(
                props.getEndpoint(), props.getRegion());
            return AmazonDynamoDBClientBuilder.standard()
                .withEndpointConfiguration(endpoint)
                .build();
        }

        val provider = ChainingAWSCredentialsProvider.getInstance(props.getCredentialAccessKey(),
            props.getCredentialSecretKey(), props.getCredentialsPropertiesFile());

        LOGGER.trace("Creating DynamoDb client configuration...");
        val cfg = AmazonClientConfigurationBuilder.buildClientConfiguration(props);

        LOGGER.debug("Creating DynamoDb client instance...");
        val clientBuilder = AmazonDynamoDBClientBuilder
            .standard()
            .withClientConfiguration(cfg)
            .withCredentials(provider);

        val region = StringUtils.defaultIfBlank(props.getRegionOverride(), props.getRegion());

        if (StringUtils.isNotBlank(props.getEndpoint())) {
            LOGGER.trace("Setting DynamoDb client endpoint [{}]", props.getEndpoint());
            clientBuilder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(props.getEndpoint(), region));
        }

        if (StringUtils.isNotBlank(region)) {
            LOGGER.trace("Setting DynamoDb client region [{}]", props.getRegion());
            clientBuilder.withRegion(region);
        }
        return clientBuilder.build();
    }
915772
@Override
	protected void loadConfig(Properties props, String path, InputStream is) {
		try {

			// load properties into a Properties object
			String jsonContent = IOUtils.toString(is);
			// create an ObjectMapper instance.
			ObjectMapper mapper = new ObjectMapper();
			mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES,
					true);

			// use the ObjectMapper to read the json string and create a tree
			JsonNode node = mapper.readTree(jsonContent);
			generateProperties(node, null, props);
		} catch (JsonParseException e) {

			throw new BundlingProcessException(
					"jawr configuration could not be loaded at " + path
							+ FIELD_NAME_SEPARATOR, e);
		} catch (IOException e) {
			throw new BundlingProcessException(
					"jawr configuration could not be loaded at " + path
							+ FIELD_NAME_SEPARATOR, e);
		}
	}
728214
@Override
    public void loadFromProperties(Properties props) {
        String strValue = props.getProperty(container.getSimpleName() + "." + name);
        if (strValue == null)
            return;

        try {
            double doubleValue = Double.parseDouble(strValue);
            set(doubleValue);
        } catch (NumberFormatException nfe) {
        }
    }
36375
static Map<String, Object> makeLoggingMap(Properties props)
  {
    Map<String, Object> loggingMap = new HashMap<>();

    loggingMap.put(
        "loggerClass", props.getProperty("org.apache.druid.java.util.emitter.logging.class", LoggingEmitter.class.getName())
    );
    loggingMap.put(
        "logLevel", props.getProperty("org.apache.druid.java.util.emitter.logging.level", "debug")
    );
    return loggingMap;
  }
1206238
public Config load() {

        ConfigResolveOptions resolveOptions = getResolveOptions();
        HashMapBindings bindings = this.bindings;
        Config config = emptyConfig();

        for (int i = 0; i < 2; i++) {

            config = emptyConfig();

            for (ConfigSource source
                    : sources.fromHighestToLowestPrecedence()) {

                config = config.withFallback(source.load(bindings));
            }

            config = config.resolve(resolveOptions);
            bindings = bindings.set(Config.class, config);
        }

        return config;
    }