Class PropertySourceUtils

java.lang.Object
com.netflix.genie.common.internal.util.PropertySourceUtils

public final class PropertySourceUtils extends Object
Utilities for working with Spring PropertySource.
Since:
4.0.0
  • Method Details

    • loadYamlPropertySource

      public static org.springframework.core.env.PropertySource<?> loadYamlPropertySource(String propertySourceName, org.springframework.core.io.Resource resource)
      Load a YAML PropertySource from the given resource.
      Parameters:
      propertySourceName - The name of the this property source
      resource - The resource. Must exist and be YAML.
      Returns:
      A PropertySource representing this set of properties
    • createPropertiesSnapshot

      public static Map<String,String> createPropertiesSnapshot(org.springframework.core.env.Environment environment, String prefix)
      Takes a snapshot of the properties that match a given prefix. The prefix is stripped from the property name. Properties with empty and null values are not included.
      Parameters:
      environment - the environment
      prefix - the prefix to match
      Returns:
      an immutable map of property name and property value in string form