Load a given {@link java.util.Properties} into a {@link ConfigNode}.

@param input The properties to load.
@return The loaded {@code ConfigNode}.
436799
public static ConfigNode load(Properties input) {
        ConfigNode config = new ConfigNode();

        load(config, input);

        return config;
    }
1035962
public static <T> InputReader getInstance(T input, String cs, Set<ParserFeature> features) throws IOException
    {
        return getInstance(input, -1, Charset.forName(cs), features);
    }
112683
public static ConfigID fromProperty(String property) {
        //TODO Perhaps there is a clever regex that could handle this
        String[] parents = property.split("//");

        ConfigID id = null;
        for (String parentString : parents) {
            id = constructId(id, parentString);
        }

        return id;
    }
408327
protected static void loadConfigSource(ConfigArgP config, String source) {
    Properties p = loadConfig(source);
    Config c = config.getConfig();
    for(String key: p.stringPropertyNames()) {
      String value = p.getProperty(key);
      ConfigurationItem ci = config.getConfigurationItem(key);      
      if(ci!=null) { // if we recognize the key, validate it
        ci.setValue(processConfigValue(value));
      }
      c.overrideConfig(key, processConfigValue(value));     
    }
  }
265001
@Override
  public Reader create(Reader input) {
    String configuration = null;
    try {
      return create(input, configuration);
    } catch (IOException e) {
      log.debug(e);
      return null;
    }
  }
704294
public static void loadProp(Props props, Configuration conf, String name) {
    String prop = props.get(name);
    if (prop != null) {
      conf.set(name, prop);
    }
  }
360006
public void load(RulesDefinition.NewRepository repo, InputStream input, String encoding) {
    load(repo, input, Charset.forName(encoding));
  }
393095
public static String getProperty(InputStream input, String key, String defaultValue) {
		String property = null;
		try {
			property = PropertiesFactory.load(input).getProperty(key);
		} catch (IOException e) {}
		return property == null ? defaultValue : property;
	}
136698
private List<StringKeyValueBean> loadConfiguration(){
		List<StringKeyValueBean> result = new LinkedList<StringKeyValueBean>();
		Resource resource = null;
		if (primaryConfigFileLocation == null){
			return result;		// fail silently because we must be in test
		}else{
			resource = new ClassPathResource(primaryConfigFileLocation);
			if (!resource.exists()){
				if (secondaryConfigFileLocation == null){
					return result;		// fail silently because we must be in test
				}
				resource = new ClassPathResource(secondaryConfigFileLocation);
			}
		}

		Properties properties = null;
		try {
			properties = PropertiesLoaderUtils.loadProperties(resource);
			
			// sort them, make the more specific ones at the top, and "*"/".*" at the bottom
			List<StringKeyValueBean> sorted = new ArrayList<StringKeyValueBean>(properties.size());
			for (Entry<Object, Object> entry: properties.entrySet()){
				sorted.add(new StringKeyValueBean(entry.getKey().toString(), entry.getValue().toString()));
			}
			Collections.sort(sorted, new Comparator<StringKeyValueBean>(){
				@Override
				public int compare(StringKeyValueBean b0,	StringKeyValueBean b1) {
					if (b0.getKey().equals(b1.getKey())){
						return 0;
					}
					if ("*".equals(b0.getKey()) || ".*".equals(b0.getKey())){
						return 1;
					}else if ("*".equals(b1.getKey()) || ".*".equals(b1.getKey())){
						return -1;
					}
					return b1.getKey().compareTo(b0.getKey());
				}
			});
			result.addAll(sorted);
		} catch (Exception e) {
			logger.warn("Cannot load environments configuration file from class path: " + 
					(resource == null ? "<null>" : resource.getDescription()), e);
		}
		
		return result;
	}
1222221
private Properties loadProperties(InputStream inputStream) throws IOException {
        Properties properties = new Properties();
        properties.load(inputStream);
        return properties;
    }
88428
public static UUID parse(String input) throws IllegalArgumentException {
        try {
            UUIDPropertyValidator.validate(input);
        } catch (ValidationException e) {
            throw new IllegalArgumentException(e.getMessage());
        }
        return UUID.fromString(input);
    }
114966
public Reader create(Reader input, String configuration, String defaultConfiguration) throws IOException {
    if(defaultConfiguration==null) {
      defaultConfiguration = defaultArgument;
    }
    if (configs != null && configs.size() > 0) {
      if (configuration == null && defaultConfiguration == null) {
        throw new IOException("no (default)configuration");
      } else if (configuration == null) {
        if (configs.get(defaultConfiguration) != null) {
          return create(input, configs.get(defaultConfiguration));
        } else {
          throw new IOException(
              "default configuration " + defaultConfiguration + " not available");
        }
      } else {
        MtasConfiguration config = configs.get(configuration);
        if (config == null) {
          if (defaultConfiguration != null) {
            if (configs.get(defaultConfiguration) != null) {
              return create(input, configs.get(defaultConfiguration));
            } else {
              throw new IOException("configuration " + configuration
                  + " not found and default configuration " + defaultConfiguration
                  + " not available");
            }
          } else {
            throw new IOException("configuration " + configuration
                + " not available and no default configuration");
          }
        } else {
          return create(input, config);
        }
      }
    } else if (config != null) {
      return create(input, config);
    } else {
      throw new IOException("no configuration");
    }

  }
787909
private static Reader loadInputStream(InputStream propertiesStream) throws IOException {
        StringBuilder buff = new StringBuilder();

        try (InputStreamReader isr = new InputStreamReader(propertiesStream, Charset.defaultCharset());
                BufferedReader reader = new BufferedReader(isr)) {
            String line;
            while ((line = reader.readLine()) != null) {
                buff.append(line).append("\n");
            }
        }

        return new StringReader(StrSubstitutor.replaceSystemProperties(buff.toString()));
    }
252084
public static ConfigObjectRecord parseString( final String input )
    {
        final ConfigObjectRecord cor = new ConfigObjectRecord();
        try
        {
            cor.parseObjectRecord( input );
        }
        catch ( Exception e )
        {
            throw new IllegalArgumentException( "Data value is mailformed, invalid ConfigObjectRecord '" + input + "'" );
        }
        return cor;
    }
1193661
public Configuration load(String pu)
    {
        Configuration conf = new Configuration().addProperties(puMetadata.getProperties());
        String propertyFileName = externalProperties != null ? (String) externalProperties
                .get(PersistenceProperties.KUNDERA_CLIENT_PROPERTY) : null;
        if (propertyFileName == null)
        {
            propertyFileName = puMetadata != null ? puMetadata
                    .getProperty(PersistenceProperties.KUNDERA_CLIENT_PROPERTY) : null;
        }
        if (propertyFileName != null)
        {
            PropertyType fileType = PropertyType.value(propertyFileName);

            switch (fileType)
            {
            case xml:
                conf.configure(propertyFileName);
                break;

            case properties:
                Properties props = new Properties();

                InputStream ioStream = puMetadata.getClassLoader().getResourceAsStream(propertyFileName);
                if (ioStream == null)
                {
                    propertyFileName = KunderaCoreUtils.resolvePath(propertyFileName);
                    try
                    {
                        ioStream = new FileInputStream(new File(propertyFileName));
                    }
                    catch (FileNotFoundException e)
                    {
                        log.warn("File {} not found, Caused by ", propertyFileName);
                    }
                }
                try
                {
                    if (ioStream != null)
                    {
                        props.load(ioStream);
                    }
                }
                catch (IOException e)
                {
                    log.error("Skipping as error occurred while loading property file {}, Cause by : {}.",
                            propertyFileName, e);
                }

                conf.addProperties(props);
                break;

            default:
                log.error("Unsupported type{} for file{}, skipping load of properties.", fileType, propertyFileName);
                break;
            }
        }

        return conf;
    }
1186206
public void load(Properties map, DynamicInitializer<C> di) throws ClassNotFoundException {
        load(map, di, /* assign key? */ false);
    }
339455
private static Properties load(String configFilePath)
	{
		Properties props = new Properties();
		BufferedInputStream fis = null;
		try {
			File configFile = new File(configFilePath);
	        fis = new BufferedInputStream(new FileInputStream(configFile));
	        props.load(fis);
        }
        catch(IOException e){
        	System.err.println("Could not load configuration file "+configFilePath);
        }
        finally{
			if(fis!=null){
			    try {
					fis.close();
				}
				catch (IOException e) {
		        	System.err.println("Error closing file stream of configuration file "+configFilePath);
				}
			}
        }
        return props;
	}