Override PropertiesLoaderSupport.mergeProprties in order to slip in a properly-configured
EncryptableProperties instance, allowing us to encrypt property values at rest.
772078
@Override
    protected Properties mergeProperties() throws IOException {

        Properties rslt = null;

        /*
         * If properties file encryption is used in this deployment, the
         * encryption key will be made available to the application as an
         * environment variable called UP_JASYPT_KEY.
         */
        final String encryptionKey = System.getenv(JAYSYPT_ENCRYPTION_KEY_VARIABLE);
        if (encryptionKey != null) {

            logger.info("Jasypt support for encrypted property values ENABLED");

            StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
            encryptor.setPassword(encryptionKey);
            rslt = new EncryptableProperties(encryptor);

            /*
             * BEGIN copied from PropertiesLoaderSupport.mergeProperties()
             */

            if (this.localOverride) {
                // Load properties from file upfront, to let local properties override.
                loadProperties(rslt);
            }

            if (this.localProperties != null) {
                for (int i = 0; i < this.localProperties.length; i++) {
                    CollectionUtils.mergePropertiesIntoMap(this.localProperties[i], rslt);
                }
            }

            if (!this.localOverride) {
                // Load properties from file afterwards, to let those properties override.
                loadProperties(rslt);
            }

            /*
             * END copied from PropertiesLoaderSupport.mergeProperties()
             */

        } else {

            logger.info(
                    "Jasypt support for encrypted property values DISABLED;  "
                            + "specify environment variable {} to use this feature",
                    JAYSYPT_ENCRYPTION_KEY_VARIABLE);

            /*
             * The feature is not in use;  defer to the Spring-provided
             * implementation of this method.
             */
            return super.mergeProperties();
        }

        return rslt;
    }
18665
public void afterPropertiesSet() throws Exception {
		Assert.notNull(authenticationEntryPoint, "authenticationEntryPoint must be specified");
		Assert.notNull(portResolver, "portResolver must be specified");
		Assert.notNull(authenticationTrustResolver, "authenticationTrustResolver must be specified");
	}
33126
private PropertyOperations addPropertiesFromDatabase(PropertyOperations sourceProperties) {
        PropertyOperations dbPropsOnly = sourceProperties.filterByKeyPrefix(ChorusConstants.DATABASE_CONFIGS_PROPERTY_GROUP + ".")
                                                         .removeKeyPrefix(ChorusConstants.DATABASE_CONFIGS_PROPERTY_GROUP + ".");
        dbPropsOnly = VariableExpandingPropertyLoader.expandVariables(dbPropsOnly, currentFeature);
        Map<String, Properties> dbPropsByDbName = dbPropsOnly.splitKeyAndGroup("\\.").loadPropertyGroups();
        PropertyOperations o = sourceProperties;
        for ( Map.Entry<String, Properties> m : dbPropsByDbName.entrySet()) {
            log.debug("Creating loader for database properties " + m.getKey());

            //current properties which may be from properties files or classpath take precedence over db properties so merge them on top
            o = properties(new JdbcPropertyLoader(m.getValue())).merge(o);
        }
        return o;
    }
1209369
public void putRawProperties(PropertyOwner propertyOwner)
    {
        if (m_messageDataDescChildren != null)
        {
            for (String strKey : m_messageDataDescChildren.keySet())
            {
                m_messageDataDescChildren.get(strKey).putRawProperties(propertyOwner);
            }
        }
    }
265165
private void addPropertyData(
      Property.Builder propertyBuilder,
      TypeElement valueType,
      ExecutableElement method,
      Optional<JacksonSupport> jacksonSupport) {
    TypeMirror propertyType = getReturnType(valueType, method, types);
    propertyBuilder
        .setAllCapsName(camelCaseToAllCaps(propertyBuilder.getName()))
        .setType(propertyType)
        .setFullyCheckedCast(CAST_IS_FULLY_CHECKED.visit(propertyType));
    if (jacksonSupport.isPresent()) {
      jacksonSupport.get().addJacksonAnnotations(propertyBuilder, method);
    }
    if (propertyType.getKind().isPrimitive()) {
      PrimitiveType unboxedType = types.getPrimitiveType(propertyType.getKind());
      TypeMirror boxedType = types.erasure(types.boxedClass(unboxedType).asType());
      propertyBuilder.setBoxedType(boxedType);
    }
  }
438968
private void mergeProperties(Map<ExecutionConfigSource, Map<ExecutionProperty, List<String>>> sourceToPropertiesMap) {
        for ( ExecutionConfigSource s : propertySources) {
            Map<ExecutionProperty, List<String>> properties = sourceToPropertiesMap.get(s);
            for ( ExecutionProperty p : properties.keySet()) {
                List<String> valuesFromSource = properties.get(p);
                if ( valuesFromSource != null && !valuesFromSource.isEmpty()) {
                    List<String> vals = getOrCreatePropertyValues(p);
                    mergeValues(valuesFromSource, p, vals);
                }
            }
        }
    }
366155
public function initializeUploadAssetAction()
    {
        $propertyMappingConfiguration = $this->arguments->getArgument('asset')->getPropertyMappingConfiguration();
        $propertyMappingConfiguration->allowAllProperties();
        $propertyMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED, true);
        $propertyMappingConfiguration->setTypeConverterOption(AssetInterfaceConverter::class, AssetInterfaceConverter::CONFIGURATION_ONE_PER_RESOURCE, true);
        $propertyMappingConfiguration->allowCreationForSubProperty('resource');
    }
945095
public static Map<String, String> mergeDefaults(
        CmsObject cms,
        Map<String, CmsXmlContentProperty> propertyConfig,
        Map<String, String> properties) {

        Map<String, String> result = new HashMap<String, String>();
        if (propertyConfig != null) {
            for (Map.Entry<String, CmsXmlContentProperty> entry : propertyConfig.entrySet()) {
                CmsXmlContentProperty prop = entry.getValue();
                String value = getPropValueIds(cms, prop.getType(), prop.getDefault());
                if (value != null) {
                    result.put(entry.getKey(), value);
                }
            }
        }
        result.putAll(properties);
        return result;
    }
1267542
public FessMessages addSuccessUploadMappingFile(String property) {
        assertPropertyNotNull(property);
        add(property, new UserMessage(SUCCESS_upload_mapping_file));
        return this;
    }
1206970
private Properties loadOverrides(File baseDir, Properties properties) throws IOException {
        return loadProperties(baseDir, properties, "override", true);
    }
70095
public void raVerifyConfiguration(ConfigProperties configProperties) throws InvalidConfigurationException {
        ConfigProperties.Property property = configProperties.getProperty(NAME_CONFIG_PROPERTY);
        if (property == null) {
            throw new InvalidConfigurationException("name property not found");
        }
        if (!property.getType().equals(String.class.getName())) {
            throw new InvalidConfigurationException("name property must be of type java.lang.String");
        }
        if (property.getValue() == null) {
            // don't think this can happen, but just to be sure
            throw new InvalidConfigurationException("name property must not have a null value");
        }
    }
1048654
@SuppressWarnings("unchecked")
    public void raConfigure(ConfigProperties properties) {
        String httpClientFactoryClassName = (String) properties.getProperty(CFG_PROPERTY_HTTP_CLIENT_FACTORY)
                .getValue();
        if (httpClientFactoryClassName.isEmpty()) {
            maxTotal = (Integer) properties.getProperty(CFG_PROPERTY_MAX_CONNECTIONS_TOTAL).getValue();

            maxForRoutes = new HashMap<HttpRoute, Integer>();

            defaultMaxForRoute = (Integer) properties.getProperty(CFG_PROPERTY_DEFAULT_MAX_FOR_ROUTE).getValue();

            String maxForRoutesString = (String) properties.getProperty(CFG_PROPERTY_MAX_CONNECTIONS_FOR_ROUTES)
                    .getValue();

            String[] maxForRoutesStrings = maxForRoutesString.split(",");

            for (String maxForRoute : maxForRoutesStrings) {
                if (maxForRoute.isEmpty()) {
                    continue;
                }
                String[] maxForRouteParts = maxForRoute.split(":");

                String scheme = maxForRouteParts[HTTP_SCHEME_INDEX];
                if (scheme == null || scheme.equals("")) {
                    scheme = HttpHost.DEFAULT_SCHEME_NAME;
                }

                String host = maxForRouteParts[HTTP_HOST_INDEX];

                String portStr = maxForRouteParts[HTTP_PORT_INDEX];
                if (portStr == null || portStr.equals("")) {
                    portStr = "80";
                }

                int port = Integer.parseInt(portStr);

                String maxForRoutePartsStr = maxForRouteParts[HTTP_MAXFORROUTE_INDEX];
                Integer max = Integer.valueOf(maxForRoutePartsStr);

                HttpRoute httpRoute = new HttpRoute(new HttpHost(host, port, scheme));

                maxForRoutes.put(httpRoute, max);
            }
        } else {
            try {
                httpClientFactory = ((Class<? extends HttpClientFactory>) Class.forName(httpClientFactoryClassName))
                        .newInstance();
            } catch (Exception e) {
                tracer.severe("failed to load http client factory class", e);
            }
        }
    }
1228520
public ConnectionPoolConfigurationBuilder withPoolProperties(Properties properties) {
      TypedProperties typed = TypedProperties.toTypedProperties(properties);
      exhaustedAction(typed.getEnumProperty(ConfigurationProperties.CONNECTION_POOL_EXHAUSTED_ACTION, ExhaustedAction.class,
         ExhaustedAction.values()[typed.getIntProperty("whenExhaustedAction", exhaustedAction.ordinal(), true)],
            true));
      maxActive(typed.getIntProperty(ConfigurationProperties.CONNECTION_POOL_MAX_ACTIVE,
                  typed.getIntProperty("maxActive", maxActive, true),
                  true));
      maxWait(typed.getLongProperty(ConfigurationProperties.CONNECTION_POOL_MAX_WAIT,
            typed.getLongProperty("maxWait", maxWait, true),
            true));
      minIdle(typed.getIntProperty(ConfigurationProperties.CONNECTION_POOL_MIN_IDLE,
            typed.getIntProperty("minIdle", minIdle, true),
            true));
      minEvictableIdleTime(typed.getLongProperty(ConfigurationProperties.CONNECTION_POOL_MIN_EVICTABLE_IDLE_TIME,
            typed.getLongProperty("minEvictableIdleTimeMillis", minEvictableIdleTime, true),
            true));
      maxPendingRequests(typed.getIntProperty(ConfigurationProperties.CONNECTION_POOL_MAX_PENDING_REQUESTS,
            typed.getIntProperty("maxPendingRequests", maxPendingRequests, true),
            true));

      lifo(typed.getBooleanProperty("lifo", lifo, true));
      maxTotal(typed.getIntProperty("maxTotal", maxTotal, true));
      maxIdle(typed.getIntProperty("maxIdle", maxIdle, true));
      numTestsPerEvictionRun(typed.getIntProperty("numTestsPerEvictionRun", numTestsPerEvictionRun, true));
      timeBetweenEvictionRuns(typed.getLongProperty("timeBetweenEvictionRunsMillis", timeBetweenEvictionRuns, true));
      testOnBorrow(typed.getBooleanProperty("testOnBorrow", testOnBorrow, true));
      testOnReturn(typed.getBooleanProperty("testOnReturn", testOnReturn, true));
      testWhileIdle(typed.getBooleanProperty("testWhileIdle", testWhileIdle, true));

      return this;
   }
596322
protected void passivateProxy( Object pProperties )
    {
        if ( pProperties == null )
        {
            return;
        }
        @SuppressWarnings( "unchecked" )
        final List<String> properties = (List<String>) pProperties;
        for ( Iterator<String> iter = properties.iterator(); iter.hasNext(); )
        {
            final String key = iter.next();
            final String value = iter.next();
            setProperty( null, key, value );
        }
    }
1071802
public Configuration withProperties(java.util.Map<String, String> properties) {
        setProperties(properties);
        return this;
    }
403794
protected void loadContentConversionPropertyValues(
            final Map<String, String> data,
            final ExecutionContext context,
            final List<Property> pluginProperties
    ) throws ConfigurationException
    {
        //look for "valueConversion" properties
        for (Property property : pluginProperties) {
            String name = property.getName();
            String propValue = data.get(name);
            if (null == propValue) {
                continue;
            }
            Map<String, Object> renderingOptions = property.getRenderingOptions();
            if (renderingOptions != null) {
                Object conversion = renderingOptions.get(StringRenderingConstants.VALUE_CONVERSION_KEY);

                if (StringRenderingConstants.ValueConversion.STORAGE_PATH_AUTOMATIC_READ.equalsOrString(conversion)) {
                    convertStoragePathValue(data, context.getStorageTree(), name, propValue, renderingOptions);
                } else if (StringRenderingConstants.ValueConversion.PRIVATE_DATA_CONTEXT.equalsOrString(conversion)) {
                    convertPrivateDataValue(data, context.getPrivateDataContextObject(), name, propValue, renderingOptions);
                }
            }
        }
    }
127211
protected Map<String, Object> decryptProperties(final Map properties) {
        return configurationCipherExecutor.decode(properties, ArrayUtils.EMPTY_OBJECT_ARRAY);
    }