Loads a key/value pair string as {@link Properties}
@since 1.392
512860
@Nonnull
    public static Properties loadProperties(@Nonnull String properties) throws IOException {
        Properties p = new Properties();
        p.load(new StringReader(properties));
        return p;
    }
706484
@Override
    public void loadFromProperties(Properties props) {
        String strValue = props.getProperty(container.getSimpleName() + "." + name);
        if (strValue == null)
            return;

        try {
            int intValue = Integer.parseInt(strValue);
            set(intValue);
        } catch (NumberFormatException nfe) {
        }
    }
711333
public Properties loadPropertyFile(File file, String encoding) {
		prop = new Prop(file, encoding);
		return prop.getProperties();
	}
462247
@Override
	public synchronized Map<Object, Object> getProperties()
	{

		if (properties == null || this.isAlwaysReload())
		{
			loadProperties();
		}

		// return copy

		return new HashMap<Object, Object>(properties);
	}
487368
private void loadJsonResource(JSONObject json, Properties properties, Object name)
                                throws JSONException {
    Iterator<?> keys = json.keys();
    while (keys.hasNext()) {
      Object obj = keys.next();
      if (!(obj instanceof String)) {
        LOG.warn("Object not instance of string : " + obj + " skipping");
        continue;
      }
      String key = (String) obj;
      // can't have . in thrift fields so we represent . with _
      String keyUnderscoresToDots = key.replace("_", ".");  
      // actual _ are represented as __ in thrift schema
      keyUnderscoresToDots = keyUnderscoresToDots.replace("..", "_");
      if (!json.isNull(key)) {
        Object value = json.get(key);
        String stringVal = "";
        if (value instanceof String) {
          stringVal = (String)value;
        } else if (value instanceof Integer) {
            stringVal = new Integer((Integer)value).toString();
        } else if (value instanceof Long) {
            stringVal = new Long((Long)value).toString();
        } else if (value instanceof Double) {
            stringVal = new Double((Double)value).toString();
        } else if (value instanceof Boolean) {
            stringVal = new Boolean((Boolean)value).toString();
        } else if (value instanceof JSONObject) {
            loadJsonResource((JSONObject)value, properties, name);
            continue;
        } else {
            LOG.warn("unsupported value in json object: " + value);
        }
        if (!finalParameters.contains(keyUnderscoresToDots)) {
          properties.setProperty(keyUnderscoresToDots, stringVal);
          updatingResource.put(keyUnderscoresToDots, name.toString());
    	} else {
    	    LOG.warn(name+":a attempt to override final parameter: "+
                     keyUnderscoresToDots+";  Ignoring.");
    	}
      } 
    }
  }
956554
protected static Properties stringToProperties(String propertiesString)
    {
        Properties properties = new Properties();

        if (propertiesString != null) {
            try {
                properties.load(new StringReader(propertiesString));
            }
            catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        return properties;
    }
83998
private void loadProperties(InputStream stream, String path) {
		if (stream == null) {
			return;
		}
		
		try {
			Properties props = new Properties();
			props.load(stream);
			
			Iterator<Object> keyIt = props.keySet().iterator();
			while (keyIt.hasNext()) {
				String key = keyIt.next().toString();
				_properties.put(key, props.get(key));
			}
		}
		catch (Exception e) {
			Console.warn("Unable to load properties file ["+path+"].");
		}
		finally {
			if (stream != null) {
				try {
					stream.close();
				}
				catch (Exception e) {
					Console.warn("Unable to close properties file ["+path+"].");
				}
			}
		}
	}
1373988
@Override
    public void loadProperties(String restClientName){
        enableDynamicProperties = true;
        setClientName(restClientName);
        loadDefaultValues();
        Configuration props = ConfigurationManager.getConfigInstance().subset(restClientName);
        for (Iterator<String> keys = props.getKeys(); keys.hasNext(); ){
            String key = keys.next();
            String prop = key;
            try {
                if (prop.startsWith(getNameSpace())){
                    prop = prop.substring(getNameSpace().length() + 1);
                }
                setPropertyInternal(prop, getStringValue(props, key));
            } catch (Exception ex) {
                throw new RuntimeException(String.format("Property %s is invalid", prop));
            }
        }
    }
1259340
private static Properties loadProperties()
   {
      Properties properties = new Properties();
      boolean loaded = false;

      String sysProperty = SecurityActions.getSystemProperty("ironjacamar.options");
      if (sysProperty != null && !sysProperty.equals(""))
      {
         File file = new File(sysProperty);
         if (file.exists())
         {
            FileInputStream fis = null;
            try
            {
               fis = new FileInputStream(file);
               properties.load(fis);
               loaded = true;
            }
            catch (Throwable t)
            {
               // Ignore
            }
            finally
            {
               if (fis != null)
               {
                  try
                  {
                     fis.close();
                  }
                  catch (IOException ioe)
                  {
                     //No op
                  }
               }
            }
         }
      }

      if (!loaded)
      {
         File file = new File(IRONJACAMAR_PROPERTIES);
         if (file.exists())
         {
            FileInputStream fis = null;
            try
            {
               fis = new FileInputStream(file);
               properties.load(fis);
               loaded = true;
            }
            catch (Throwable t)
            {
               // Ignore
            }
            finally
            {
               if (fis != null)
               {
                  try
                  {
                     fis.close();
                  }
                  catch (IOException ioe)
                  {
                     //No op
                  }
               }
            }
         }
      }

      if (!loaded)
      {
         InputStream is = null;
         try
         {
            ClassLoader cl = Main.class.getClassLoader();
            is = cl.getResourceAsStream(IRONJACAMAR_PROPERTIES);
            properties.load(is);
            loaded = true;
         }
         catch (Throwable t)
         {
            // Ignore
         }
         finally
         {
            if (is != null)
            {
               try
               {
                  is.close();
               }
               catch (IOException ioe)
               {
                  // Nothing to do
               }
            }
         }
      }

      return properties;
   }
440764
private static void loadProperties(Properties properties,InputStream inputStream,boolean internal)
    {
        try
        {
            properties.load(inputStream);
            LibraryConfigurationLoader.closeResource(inputStream);
        }
        catch(Exception exception)
        {
            LibraryConfigurationLoader.closeResource(inputStream);
            String prefix="External";
            if(internal)
            {
                prefix="Internal";
            }
            throw new FaxException(prefix+" "+LibraryConfigurationLoader.CONFIGURATION_FILE_NAME+" not found.",exception);
        }
    }
128675
public static Properties loadProperties(InputStream inputStream) {
        Properties prop = new Properties();
        try {
            prop.load(inputStream);
        } catch (IOException e) {
            throw E.ioException(e);
        } finally {
            IO.close(inputStream);
        }
        return prop;
    }
222618
public static Map<String, String> loadProperties(InputStream is)
        throws StorageException {
        Map<String, String> propertiesMap = null;
        if (is != null) {
            try {
                String properties = readStringFromStream(is);
                propertiesMap = deserializeMap(properties);
            } catch (Exception e) {
                String err = "Could not read properties " +
                             " due to error: " + e.getMessage();
                throw new StorageException(err, e);
            }
        }

        if (propertiesMap == null) {
            propertiesMap = new HashMap<String, String>();
        }

        return propertiesMap;
    }
1117332
private Properties loadPropertiesFile(File propertiesFile) throws MojoExecutionException { // NOSONAR
        try (FileInputStream propertiesFileInputStream = new FileInputStream(propertiesFile)) {
            Properties loadedProperties = new Properties();
            loadedProperties.load(propertiesFileInputStream);
            return loadedProperties;
        } catch (IOException e) {
            throw new MojoExecutionException(e.getMessage(), e);
        }
    }
1143085
private Properties loadLegacyTokenProperties(InputStream inputStream) throws JinxException {
    Properties p = new Properties();
    try {
      p.loadFromXML(inputStream);
    } catch (Exception e) {
      throw new JinxException("Unable to load data from input stream.", e);
    }
    return p;
  }
901627
@SuppressWarnings("unused")
	private List<String> loadListProperty(String propertyKey) {
		String arrayPropValue = prop.getProperty(propertyKey);
		if (arrayPropValue != null && !arrayPropValue.isEmpty()) {
			String [] values = arrayPropValue.trim().split(",");
			for (int i = 0; i < values.length; i++) {
				values[i] = values[i].trim();
			}
			return Arrays.asList(values);
		} else {
			return null;
		}
	}
409351
protected void loadQueryProperties(String propertyFilename) throws IOException {

        Properties properties = new Properties();
        properties.load(getClass().getClassLoader().getResourceAsStream(propertyFilename));
        @SuppressWarnings("unchecked")
        Enumeration<String> propertyNames = (Enumeration<String>)properties.propertyNames();
        while (propertyNames.hasMoreElements()) {
            String propertyName = propertyNames.nextElement();
            m_queries.put(propertyName, properties.getProperty(propertyName));
        }
    }
1058564
private void reloadProperties() {
        Properties temp = new Properties();
        BufferedReader bufferedReader = null;
        try {
            bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(propertiesFile), "UTF8"));
            temp.load(bufferedReader);
            this.properties = temp;
        } catch (IOException e) {
            error("Error while trying to load the Properties-File: "
                    + propertiesFile.getAbsolutePath(), e);
        } finally {
            if (bufferedReader != null) {
                try {
                    bufferedReader.close();
                } catch (IOException e) {
                    error("Unable to close input stream", e);
                }
            }
        }
    }