Loads properties using a key/value loader. This allows properties files to be
parsed the same way as for for Properties classes, but key/value pairs can be
stored independently.

@hide internal use only
194946
public static void loadLineReader(LineReader lr, KeyValueLoader loader) throws IOException {
        char[] convtBuf = new char[1024];
        int limit;
        int keyLen;
        int valueStart;
        char c;
        boolean hasSep;
        boolean precedingBackslash;

        while ((limit = lr.readLine()) >= 0) {
            c = 0;
            keyLen = 0;
            valueStart = limit;
            hasSep = false;

            //System.out.println("line=<" + new String(lineBuf, 0, limit) + ">");
            precedingBackslash = false;
            while (keyLen < limit) {
                c = lr.lineBuf[keyLen];
                //need check if escaped.
                if ((c == '=' ||  c == ':') && !precedingBackslash) {
                    valueStart = keyLen + 1;
                    hasSep = true;
                    break;
                }
                // Android-changed: use of Character.isWhitespace(c) b/25998006
                else if (Character.isWhitespace(c) && !precedingBackslash) {
                    valueStart = keyLen + 1;
                    break;
                }
                if (c == '\\') {
                    precedingBackslash = !precedingBackslash;
                } else {
                    precedingBackslash = false;
                }
                keyLen++;
            }
            while (valueStart < limit) {
                c = lr.lineBuf[valueStart];
                // Android-changed: use of Character.isWhitespace(c) b/25998006
                if (!Character.isWhitespace(c)) {
                    if (!hasSep && (c == '=' ||  c == ':')) {
                        hasSep = true;
                    } else {
                        break;
                    }
                }
                valueStart++;
            }
            String key = loadConvert(lr.lineBuf, 0, keyLen, convtBuf);
            String value = loadConvert(lr.lineBuf, valueStart, limit - valueStart, convtBuf);
            loader.load(key, value);
        }
    }
1032327
public static Properties load(InputStream input) throws IOException {
		Properties properties = new Properties();
		properties.load(input);
		return properties;
	}
1282796
def load
      parsed = JSON.parse(File.read(SPECPATH))
      structs = StructureContainer.new(parsed['PropertyTypes'])

      parsed['ResourceTypes'].each do |key, spec|
        match = key.match(/\A(\w+)::(\w+)::(\w+)\z/)

        register(match[1], match[2], match[3], spec, structs.search(key))
      end
    end
48886
protected void load()
    {
        properties = new Properties();

        String filename = getFilename();
        
        try
        {
            URL url = ClassHelper.getResource(filename);

            if (url == null)
            {
                url = (new File(filename)).toURL();
            }

            logger.info("Loading OJB's properties: " + url);

            URLConnection conn = url.openConnection();
            conn.setUseCaches(false);
            conn.connect();
            InputStream strIn = conn.getInputStream();
            properties.load(strIn);
            strIn.close();
        }
        catch (FileNotFoundException ex)
        {
            // [tomdz] If the filename is explicitly reset (null or empty string) then we'll
            //         output an info message because the user did this on purpose
            //         Otherwise, we'll output a warning
            if ((filename == null) || (filename.length() == 0))
            {
                logger.info("Starting OJB without a properties file. OJB is using default settings instead.");
            }
            else
            {
                logger.warn("Could not load properties file '"+filename+"'. Using default settings!", ex);
            }
            // [tomdz] There seems to be no use of this setting ?
            //properties.put("valid", "false");
        }
        catch (Exception ex)
        {
            throw new MetadataException("An error happend while loading the properties file '"+filename+"'", ex);
        }
    }
635178
public PropertiesLoaderBuilder loadAllPropertiesFromSpring() {
        for (PropertySource<?> propertySource : env.getPropertySources()) {
            if (propertySource instanceof MapPropertySource) {
                MapPropertySource mapPropSource = (MapPropertySource) propertySource;
                for (String propName : mapPropSource.getPropertyNames()) {
                    if (!props.containsKey(propName)) {
                        props.put(propName, env.getProperty(propName));
                    }
                }
            }
        }
        return this;
    }
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);
        }
    }
728214
@Override
    public void loadFromProperties(Properties props) {
        String strValue = props.getProperty(container.getSimpleName() + "." + name);
        if (strValue == null)
            return;

        try {
            double doubleValue = Double.parseDouble(strValue);
            set(doubleValue);
        } catch (NumberFormatException nfe) {
        }
    }
393656
private void loadKeystore() {
		String keypath = this.getProperty(KEY_PATH_PROPERTY_KEY);
		String keyEntryName = this.getProperty(ENTRY_NAME_PROPERTY_KEY);
		String keyStorePassword = this
				.getProperty(KEYSTORE_PASSWORD_PROPERTY_KEY);

		loadKeystore(keypath, keyStorePassword, keyEntryName);

	}
706140
public static Properties loadProperties(String fileName) {
        LowerCaseProperties properties = new LowerCaseProperties();
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        URL url = classLoader.getResource(fileName);

        // try opening from classpath
        if (url != null) {
            InputStream urlStream = null;
            try {
                urlStream = url.openStream();
                properties.load(urlStream);

                logger.info("Properties from classpath loaded file: " + fileName);
            } catch (IOException e) {
                logger.info("Properties from classpath not loaded because file not found: " + fileName);
            } finally {
                if (urlStream != null) {
                    try {
                        urlStream.close();
                    } catch (IOException e) {
                    }
                }
            }
        }

        // Override properties found on the classpath with any found in a file
        // of the same name
        LowerCaseProperties propertiesFromFileSystem = loadProperties(new File(fileName));
        properties.putAll(propertiesFromFileSystem);
        return properties;
    }
1121465
private function loadUnsettableProperties()
    {
        $this->unsetableProperties = array();
        foreach( $this->dataTypes as $name => $dataType ) {
            if( $dataType->isUnsettable() ) {
                $this->unsetableProperties[] = $name;
            }
        }
    }
375628
@Override
    public void loadFromProperties(Properties props) {
        String strValue = props.getProperty(container.getSimpleName() + "." + name);
        if (strValue == null)
            return;

        try {
            float value = Float.parseFloat(strValue);
            set(value);
        } catch (NumberFormatException nfe) {
        }
    }
1158343
@Override
    public void loadFromProperties(Properties props) {
        String strValue = props.getProperty(container.getSimpleName() + "." + name);
        if (strValue == null)
            return;

        try {
            long value = Long.parseLong(strValue);
            set(value);
        } catch (NumberFormatException nfe) {
        }
    }
840872
private static void loadProperty(String filePath)
    {
        try (InputStream propertyStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(
                filePath);
                Reader propertyReader = new InputStreamReader(propertyStream, DEFAULT_CHARSET);)
        {
            Properties properties = new Properties();
            properties.load(propertyReader);
            propertiesMap.put(filePath, properties);
        }
        catch (Exception ex)
        {
            String errorPattern = "Property file load failed. Skip load. : PropertyFile={0}";
            logger.warn(MessageFormat.format(errorPattern, filePath), ex);
        }
    }
1254374
function loadService(info, key, service) {

    const item = parseService(info, key, service);

    const target = loader.app.serviceClasses;

    // item { properties: [ 'a', 'b', 'c'], exports }
    // => target.a.b.c = exports
    item.properties.reduce((target, property, index) => {
      let obj;
      const properties = item.properties.slice(0, index + 1).join('.');
      if (index === item.properties.length - 1) {
        if (property in target) {
          if (!loader.options.override) throw new Error(`can't overwrite property '${properties}' from ${target[property][loader.FileLoader.FULLPATH]} by ${item.pathName}`);
        }
        obj = item.exports;
        if (obj && !is.primitive(obj)) {
          obj[loader.FileLoader.FULLPATH] = item.pathName;
          obj[loader.FileLoader.EXPORTS] = true;
        }
      } else {
        obj = target[property] || {};
      }
      target[property] = obj;
      return obj;
    }, target);

    return item;
  }
726612
@Override
	public void load(final InputStream inStream) throws IOException {
		lock.writeLock().lock();
		try {
			properties.load(inStream);
		} finally {
			lock.writeLock().unlock();
		}
	}
979483
private function loadProperties()
    {
        try {
            $properties = new Properties();
            $properties->load($this->file);
        } catch (IOException $ioe) {
            throw new BuildException($ioe);
        }
        return $properties;
    }
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;
   }