/** * Process the properties passed in so they are ready for use by a Spring context.<br> * * 1 - Override with system/environment properties<br> * 2 - Decrypt any ENC(...) values<br> * 3 - Resolve all property values throwing an exception if any are unresolvable.<br> */ public static void prepareContextProperties(Properties properties) { prepareContextProperties(properties, null); }
@Deprecated public static PropertySource<?> getPropertySource(String name, List<org.kuali.common.util.property.ProjectProperties> pps) { // Load them from disk Properties source = PropertyUtils.load(pps); // Prepare them so they are ready for use PropertyUtils.prepareContextProperties(source); // Return a PropertySource backed by the properties return new PropertiesPropertySource(name, source); }
/** * Return a SpringContext that resolves all placeholders from the PropertySource passed in */ @Deprecated public static PropertySource<?> getGlobalPropertySource(List<String> locations, String encoding) { Properties loaded = PropertyUtils.load(locations, encoding); Properties global = PropertyUtils.getGlobalProperties(loaded); PropertyUtils.prepareContextProperties(global); return getGlobalPropertySource(global); }
/** * Add organization, group, and path properties and tokenize the version number adding properties for each token along with a boolean property indicating if this is a SNAPSHOT * build */ public static void augmentProjectProperties(Properties mavenProperties) { // Setup some processors List<PropertyProcessor> processors = newArrayList(); // Add some organization, group, and path properties processors.add(new org.kuali.common.util.property.processor.ProjectProcessor()); // Tokenize the version number and add properties for each token (major/minor/incremental) // Also add a boolean property indicating if this is a SNAPSHOT build processors.add(new VersionProcessor(asList(MavenConstants.VERSION_KEY), true)); // Process default Maven properties and add in our custom properties PropertyUtils.process(mavenProperties, processors); // Finish preparing the properties using the encoding from the project String encoding = getRequiredResolvedProperty(mavenProperties, MavenConstants.ENCODING_KEY); prepareContextProperties(mavenProperties, encoding); }
@Deprecated public static PropertySource<?> getGlobalPropertySource(String name, List<org.kuali.common.util.property.ProjectProperties> pps) { // Load them from disk Properties source = PropertyUtils.load(pps); // Add in system/environment properties Properties globalSource = PropertyUtils.getGlobalProperties(source); logger.debug("Before prepareContextProperties()"); PropertyUtils.debug(globalSource); // Prepare them so they are ready for use PropertyUtils.prepareContextProperties(globalSource); logger.debug("After prepareContextProperties()"); PropertyUtils.debug(globalSource); // Return a PropertySource backed by the properties return new PropertiesPropertySource(name, globalSource); }