Load the <code>Config</code> with properties from the stream
<code>in</code> from a <code>Properties</code> file.
487326
public static void load( InputStream in ) throws IOException {
        if( in != null ) {
            prp.load( in );
        }
        try {
            prp.putAll( (java.util.Map)System.getProperties().clone() );
        } catch( SecurityException se ) {
            if( log.level > 1 )
                log.println( "SecurityException: jcifs will ignore System properties" );
        }
    }
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);
        }
    }
660536
private void loadFrom(final InputStream inputStream) throws IOException {
    final Properties properties = new Properties();
    properties.load(inputStream);
    this.put(properties);
  }
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);
                }
            }
        }
    }
353720
public Boolean loadPropertiesFile(String path) throws IOException
    {
        Properties prop = new Properties();
        InputStream input = null;

        try {

            input = new FileInputStream(path);
            prop.load(input);

            for(String key : prop.stringPropertyNames()) {
                String value = prop.getProperty(key);
                configs.put(key, value);
            }

            return true;
        } catch (IOException ex) {
            return false;
        }
    }
1098125
public void load(InputStream stream, String separator) throws IOException, PropertiesException {
		 
		try(DataInputStream data = new DataInputStream(stream); Reader reader = new InputStreamReader(data); BufferedReader br = new BufferedReader(reader)) {
			String line;
			StringBuilder buffer = new StringBuilder();
			while ((line = br.readLine()) != null)   {
				if(Strings.trimRight(line).startsWith(LINE_COMMENT_START)) {
					// comment line, skip!
					continue;
				} else {					
					// now check if multi-line property
					if(line.endsWith(CONTINUE_ON_NEW_LINE)) {
						// middle line in multi-line, add and skip parsing
						buffer.append(line.replaceFirst("\\\\$", ""));
						continue;
					} else {
						// ordinary line, or end of multi-line: add and parse
						buffer.append(line);
					}
				}
				line = buffer.toString().trim();
				buffer.setLength(0);
				int index = -1;
				if(line.length() > 0 && (index = line.lastIndexOf(separator)) != -1) {
					String key = line.substring(0, index).trim();
					String value = line.substring(index + separator.length()).trim();
					if("@".equals(key)) {
						logger.trace("including and overriding values defined so far with file '{}'", value);
						load(value, separator);
					} else {
						logger.trace("adding '{}' => '{}'", key, value);
						this.put(key.trim(), value.trim());
					}
				}
			}
			if(buffer.length() > 0) {
				logger.warn("multi-line property '{}' is not properly terminated", buffer);
			}
		}
	}
1347148
private static void loadConfig() throws FileNotFoundException, IOException {
        try (InputStream configStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(CONFIG_FILE)) {
            if (configStream == null) {
                throw new FileNotFoundException();
            }

            properties = new Properties();
            properties.load(configStream);
        }

        // Read properties
        accountId = properties.getProperty("customerAccountId");
        createS3Bucket = Boolean.valueOf(properties.getProperty("createS3Bucket"));
        s3RegionName = properties.getProperty("s3RegionName");
        s3BucketName = properties.getProperty("s3BucketName").trim();
        s3BucketARN = getBucketARN(s3BucketName);
        s3ObjectPrefix = properties.getProperty("s3ObjectPrefix").trim();

        String sizeInMBsProperty = properties.getProperty("destinationSizeInMBs");
        s3DestinationSizeInMBs = StringUtils.isNullOrEmpty(sizeInMBsProperty) ? null : Integer.parseInt(sizeInMBsProperty.trim());
        String intervalInSecondsProperty = properties.getProperty("destinationIntervalInSeconds");
        s3DestinationIntervalInSeconds = StringUtils.isNullOrEmpty(intervalInSecondsProperty) ? null : Integer.parseInt(intervalInSecondsProperty.trim());

        deliveryStreamName = properties.getProperty("deliveryStreamName");
        s3DestinationAWSKMSKeyId = properties.getProperty("destinationAWSKMSKeyId");
        firehoseRegion = properties.getProperty("firehoseRegion");
        iamRoleName = properties.getProperty("iamRoleName");
        iamRegion = properties.getProperty("iamRegion");

        // Update Delivery Stream Destination related properties
        enableUpdateDestination = Boolean.valueOf(properties.getProperty("updateDestination"));
        updateS3ObjectPrefix = properties.getProperty("updateS3ObjectPrefix").trim();
        String updateSizeInMBsProperty = properties.getProperty("updateSizeInMBs");
        updateSizeInMBs = StringUtils.isNullOrEmpty(updateSizeInMBsProperty) ? null : Integer.parseInt(updateSizeInMBsProperty.trim());
        String updateIntervalInSecondsProperty = properties.getProperty("updateIntervalInSeconds");
        updateIntervalInSeconds = StringUtils.isNullOrEmpty(updateIntervalInSecondsProperty) ? null : Integer.parseInt(updateIntervalInSecondsProperty.trim());
    }
79089
public static Properties loadProperties(File file) throws IOException {
        FileInputStream finp = new FileInputStream(file);
        try {
            Properties p = new Properties();
            p.load(finp);
            return p;
        } finally {
            ArchiveUtils.closeQuietly(finp);
        }
    }
551945
private static void loadLocalProps() {
        if (null == localProps) {
            localProps = new Properties();
        }

        try {
            InputStream resourceAsStream;
            final String localPropsEnv = System.getenv("LATKE_LOCAL_PROPS");
            if (StringUtils.isNotBlank(localPropsEnv)) {
                LOGGER.debug("Loading local.properties from env var [$LATKE_LOCAL_PROPS=" + localPropsEnv + "]");
                resourceAsStream = new FileInputStream(localPropsEnv);
            } else {
                LOGGER.debug("Loading local.properties from classpath [/local.properties]");
                resourceAsStream = Latkes.class.getResourceAsStream("/local.properties");
            }

            if (null != resourceAsStream) {
                localProps.load(resourceAsStream);
                LOGGER.debug("Loaded local.properties");
            }
        } catch (final Exception e) {
            LOGGER.log(Level.DEBUG, "Loads local.properties failed, ignored");
        }
    }
742904
protected void loadConfigs() {
        configs = new Properties();
        // If run as a jar, find in file system classpath first, if not found, then get resource in jar.
        if (ClassPathUtil.testRunMainInJar()) {
            String[] classPathsInFileSystem = ClassPathUtil.getAllClassPathNotInJar();
            String workDir = System.getProperty("user.dir");
            String mainJarRelativePath = ClassPathUtil.getClassPathsInSystemProperty()[0];
            File mainJar = new File(workDir, mainJarRelativePath);
            File mainJarDir = mainJar.getParentFile();
            for (String classPath : classPathsInFileSystem) {
                File classPathFile = new File(classPath);
                File configFile;
                if (classPathFile.isAbsolute()) {
                    configFile = new File(classPathFile, propertiesAbsoluteClassPath);
                } else {
                    configFile = new File(new File(mainJarDir, classPath), propertiesAbsoluteClassPath);
                }
                if (configFile.exists() && configFile.isFile()) {
                    InputStream is = null;
                    try {
                        is = new FileInputStream(configFile);
                        loadConfigsFromStream(is);
                    } catch (FileNotFoundException e) {
                        LOGGER.warn("Load config file " + configFile.getPath() + " error!", e);
                    }
                    return;
                }
            }
        }
        if (propertiesFilePath == null) {
            if (propertiesAbsoluteClassPath == null) {
                return;
            }
            InputStream is = OneProperties.class.getResourceAsStream(propertiesAbsoluteClassPath);
            loadConfigsFromStream(is);
        } else {
            configs = PropertiesIO.load(propertiesFilePath);
        }
    }
1107521
private void loadPropFile(String propFileName) throws IOException, Error {

		InputStream inputStream = null;
		try {
			inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);
			if (inputStream != null) {
				this.prop.load(inputStream);
				LOGGER.debug("properties file " + propFileName + " loaded succesfully");
			} else {
				String errorMsg = "properties file '" + propFileName + "' not found in the classpath";
				LOGGER.error(errorMsg);
				throw new Error(errorMsg, Error.SETTINGS_FILE_NOT_FOUND);
			}
		} finally {
			try {
				if (inputStream != null) {
					inputStream.close();
				}
			} catch (IOException e) {
				LOGGER.warn("properties file '"  + propFileName +  "' not closed properly.");
			}
		}
	}
248879
@SuppressWarnings("resource")
	public static AsyncWork<Properties, Exception> loadPropertiesFile(
		IO.Readable.Buffered input, Charset charset, byte priority, IO.OperationType closeInputAtEnd, Listener<Properties> onDone
	) {
		BufferedReadableCharacterStream cs = new BufferedReadableCharacterStream(input, charset, 512, 32);
		return loadPropertiesFile(cs, priority, closeInputAtEnd, onDone);
	}
786558
public static Properties loadProperties(String filename) throws ConfigurableException {
        log.info("Loading properties from " + filename);
        Properties properties = new Properties();
        FileInputStream input = null;
        try {
            input = new FileInputStream(filename);
            properties.load(input);
        } catch (IOException e) {
            final String errMessage = e.getClass().getSimpleName() + ": " + e.getMessage();
            log.error(errMessage, e);
            throw new ConfigurableException(errMessage, e);
        } finally {
            if (null != input) {
                try {
                    input.close();
                } catch (IOException e) {
                    final String errMessage = e.getClass().getSimpleName() + ": " + e.getMessage();
                    log.error(errMessage, e);
                }
            }
        }

        return properties;
    }
767525
public Properties loadPropertyFile(String fileName, String encoding) {
		prop = new Prop(fileName, encoding);
		return prop.getProperties();
	}
732933
public static Properties loadProperties(Class<?> clazz, String fileName) throws IOException {
        Properties properties = new Properties();
        try (InputStream is = clazz.getClassLoader().getResourceAsStream(fileName)) {
            properties.load(is);
        }
        return properties;
    }
1243730
private void addPropertiesFromFile(final SystemProperties config, final ServletContext context) {
        String fileLocation = StringUtils.replaceVariables(config.getFile(), new HashMap<String, Object>(), true);
        InputStream inStream = null;
        try {
            inStream = getStreamForLocation(fileLocation, context);
            Properties propsFromFile = new Properties();
            propsFromFile.load(inStream);
            for (String prop : propsFromFile.stringPropertyNames()) {
                String propertyValue = propsFromFile.getProperty(prop);
                if (propertyValue != null && (config.isOverrideProperties() || (System.getProperty(prop) == null))) {
                    System.setProperty(prop, propertyValue);
                }
            }
        } catch (FileNotFoundException e) {
            if (!config.isIgnoreMissingFile()) { 
                throw new IllegalStateException("Could not find properties file: " + fileLocation, e);
            }
        } catch (IOException e) {
            if (!config.isIgnoreMissingFile()) { 
                throw new IllegalStateException("Error occurred when reading properties file: " + fileLocation, e);
            }
        } finally {
            if (inStream != null) {
                try {
                    inStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
712152
public void load(String config)
        throws IOException
    {
        _config=config;
        if(log.isDebugEnabled())log.debug("Load "+this+" from "+config);
        Properties properties = new Properties();
        Resource resource=Resource.newResource(config);
        properties.load(resource.getInputStream());

        Iterator iter = properties.entrySet().iterator();
        while(iter.hasNext())
        {
            Map.Entry entry = (Map.Entry)iter.next();

            String username=entry.getKey().toString().trim();
            String credentials=entry.getValue().toString().trim();
            String roles=null;
            int c=credentials.indexOf(',');
            if (c>0)
            {
                roles=credentials.substring(c+1).trim();
                credentials=credentials.substring(0,c).trim();
            }

            if (username!=null && username.length()>0 &&
                credentials!=null && credentials.length()>0)
            {
                put(username,credentials);
                if(roles!=null && roles.length()>0)
                {
                    StringTokenizer tok = new StringTokenizer(roles,", ");
                    while (tok.hasMoreTokens())
                        addUserToRole(username,tok.nextToken());
                }
            }
        }
    }