Load property file.
Example:<br>
loadPropertyFile("db_username_pass.txt", "UTF-8");

@param fileName the file in CLASSPATH or the sub directory of the CLASSPATH
@param encoding the encoding
767525
public Properties loadPropertyFile(String fileName, String encoding) {
		prop = new Prop(fileName, encoding);
		return prop.getProperties();
	}
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.");
			}
		}
	}
439396
public static Map<String, File> loadStringToFileMap(final File f) throws IOException {
    return loadStringToFileMap(Files.asCharSource(f, Charsets.UTF_8));
  }
1083702
public static String loadString(String file) throws IOException {
		StringBuilder sb = new StringBuilder();
		UnicodeReader reader = new UnicodeReader(new FileInputStream(file), "utf8");
		int n;	
		char[] cs = new char[256];
		while ((n = reader.read(cs)) != -1) {		
			sb.append(Arrays.copyOfRange(cs, 0, n));			
		}
		return sb.toString();
	}
1226535
public static AsyncWork<Properties, Exception> loadPropertiesFile(
		IO.Readable input, Charset charset, byte priority, IO.OperationType closeInputAtEnd, Listener<Properties> onDone
	) {
		if (!(input instanceof IO.Readable.Buffered))
			input = new PreBufferedReadable(input, 512, priority, 1024, priority, 16);
		return loadPropertiesFile((IO.Readable.Buffered)input, charset, priority, closeInputAtEnd, onDone);
	}
1191720
private Properties loadProperties(File baseDir, Properties currentProperties, String key, boolean override) throws IOException {
        Properties loadedProperties = new Properties();

        String include = (String) currentProperties.remove(key);
        if (!StringUtils.isNullOrEmpty(include)) {
            // allow for multiples
            List<String> names = StringUtils.getList(include, DEFAULT_LIST_DELIMITER);
            for (String name : names) {
                if (StringUtils.isNullOrEmpty(name)) {
                    continue;
                }

                // interpolate any variables
                final String fileName = interpolateString(name);

                // try co-located
                File file = new File(baseDir, fileName);
                if (!file.exists()) {
                    // try absolute path
                    file = new File(fileName);
                }

                if (!file.exists()) {
                    log.warn("failed to locate {}", file);
                    continue;
                }

                // load properties
                log.debug("loading {} settings from {}", key, file);
                try (FileInputStream iis = new FileInputStream(file)) {
                    loadedProperties.load(iis);
                }

                // read nested properties
                loadedProperties = loadProperties(file.getParentFile(), loadedProperties, key, override);
            }
        }

        Properties merged = new Properties();
        if (override) {
            // "override" settings overwrite the current properties
            merged.putAll(currentProperties);
            merged.putAll(loadedProperties);
        } else {
            // "include" settings are overwritten by the current properties
            merged.putAll(loadedProperties);
            merged.putAll(currentProperties);
        }

        return merged;
    }
743974
private static Map<String, String> getProperties(String fileName)
    {
        if (kunderaBlockchainProps == null || kunderaBlockchainProps.isEmpty())
        {
            Configuration config = null;
            try
            {
                config = new PropertiesConfiguration(fileName);

            }
            catch (ConfigurationException ce)
            {
                LOGGER.error("Not able to load properties from  " + fileName + " file. ", ce);
                throw new KunderaException("Not able to load properties from  " + fileName + " file. ", ce);
            }
            kunderaBlockchainProps = (Map) ConfigurationConverter.getProperties(config);
            LOGGER.info("Properties loaded from " + fileName + " file. Properties: " + kunderaBlockchainProps);
        }
        return kunderaBlockchainProps;
    }
7073
public void load(File file) {
    try {
      PropertiesConfiguration config = new PropertiesConfiguration();
      // disabled to prevent accumulo classpath value from being shortened
      config.setDelimiterParsingDisabled(true);
      config.load(file);
      ((CompositeConfiguration) internalConfig).addConfiguration(config);
    } catch (ConfigurationException e) {
      throw new IllegalArgumentException(e);
    }
  }
650522
@Override
	protected void loadProperties(final Properties props) throws IOException {
		if (locations != null) {
			for (int i = 0; i < locations.length; i++) {
				final Resource location = locations[i];
				if (logger.isInfoEnabled()) {
					logger.info("Loading properties file from " + location);
				}
				File file = null;
				InputStream is = null;
				try {
					try {
						file = location.getFile();
						is = new BufferedInputStream(new FileInputStream(file));
					} catch (final IOException ie) {// ignore
					} finally {
						if (file == null) {
							is = location.getInputStream();
						}
					}

					if (location.getFilename().toLowerCase().endsWith(Constants.XML_FILE_EXTENSION)) {
						persister.loadFromXml(props, is);
					} else if (location.getFilename().toLowerCase().endsWith(Constants.JSON_FILE_EXTENSION)) {
						if (fileEncoding != null) {
							persister.loadFromJson(props, new InputStreamReader(is, Charset.forName(fileEncoding)));
						} else {
							persister.loadFromJson(props, is);
						}
					} else if (location.getFilename().toLowerCase().endsWith(Constants.YAML_FILE_EXTENSION)) {
						if (fileEncoding != null) {
							persister.loadFromYAML(props, new InputStreamReader(is, Charset.forName(fileEncoding)));
						} else {
							persister.loadFromYAML(props, is);
						}
					} else {
						if (fileEncoding != null) {
							persister.load(props, new InputStreamReader(is, Charset.forName(fileEncoding)));
						} else {
							persister.load(props, is);
						}
					}
				} catch (final IOException ex) {
					if (ignoreResourceNotFound) {
						if (logger.isWarnEnabled()) {
							logger.warn("Could not load properties from " + location + ": " + ex.getMessage());
						}
					} else {
						throw ex;
					}
				} finally {
					if (is != null) {
						is.close();
					}
				}
			}
		}
	}
1203441
public static Properties loadFile(File file) throws IOException {
		InputStream input = new FileInputStream(file);
		Properties prop = null;
		try {
			prop = load(input);
		} finally {
			IOUtils.close(input);
		}
		return prop;
	}
412347
@Override
    public boolean loadValuesFrom(String filename) {
        String propContent = textIn(filename);
        PropertiesHelper propHelper = getEnvironment().getPropertiesHelper();
        Properties properties = propHelper.parsePropertiesString(propContent);
        Map<String, Object> propAsMap = propHelper.convertPropertiesToMap(properties);
        getCurrentValues().putAll(propAsMap);
        return true;
    }
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);
        }
    }
882085
public static Properties readPropertiesFile(String fileName) {
		InputStream in = getInputStream(fileName);
		if (in != null) {
			return readPropertiesStream(in);
		}
		return new Properties();
	}
193333
public final void load(final String filename) {
        logger.debug("Loading the cache from places file: " + filename);
        try (
            InputStream fis = new FileInputStream(filename);
        ) {
            load(fis);
        } catch (IOException e) {
            logger.error("Problem reading places file", e);
        }
    }
484771
@SuppressWarnings("unchecked")
    public void load(File propertiesFile) throws IOException {
        String paramName;
        String paramValue;
        
        Reader reader = new FileReader(propertiesFile);
        _properties.load(reader);
        reader.close();
        
        paramName = StoreParams.PARAM_INDEXES_CACHED;
        paramValue = _properties.getProperty(paramName);
        setIndexesCached(parseBoolean(paramName, paramValue, StoreParams.INDEXES_CACHED_DEFAULT));
        
        paramName = StoreParams.PARAM_BATCH_SIZE;
        paramValue = _properties.getProperty(paramName);
        setBatchSize(parseInt(paramName, paramValue, StoreParams.BATCH_SIZE_DEFAULT));
        
        paramName = StoreParams.PARAM_NUM_SYNC_BATCHES;
        paramValue = _properties.getProperty(paramName);
        setNumSyncBatches(parseInt(paramName, paramValue, StoreParams.NUM_SYNC_BATCHES_DEFAULT));
        
        paramName = StoreParams.PARAM_SEGMENT_FILE_SIZE_MB;
        paramValue = _properties.getProperty(paramName);
        setSegmentFileSizeMB(parseInt(paramName, paramValue, StoreParams.SEGMENT_FILE_SIZE_MB_DEFAULT));
        
        paramName = StoreParams.PARAM_SEGMENT_COMPACT_FACTOR;
        paramValue = _properties.getProperty(paramName);
        setSegmentCompactFactor(parseDouble(paramName, paramValue, StoreParams.SEGMENT_COMPACT_FACTOR_DEFAULT));
        
        paramName = StoreParams.PARAM_HASH_LOAD_FACTOR;
        paramValue = _properties.getProperty(paramName);
        setHashLoadFactor(parseDouble(paramName, paramValue, StoreParams.HASH_LOAD_FACTOR_DEFAULT));
        
        // Create _segmentFactory
        paramName = StoreParams.PARAM_SEGMENT_FACTORY_CLASS;
        paramValue = _properties.getProperty(paramName);
        SegmentFactory segmentFactory = null;
        if(paramValue != null) {
            try {
                segmentFactory = Class.forName(paramValue).asSubclass(SegmentFactory.class).newInstance();
            } catch(Exception e) {
                _logger.warn("Invalid SegmentFactory class: " + paramValue);
            }
        }
        if(segmentFactory == null) {
            segmentFactory = new MappedSegmentFactory();
        }
        setSegmentFactory(segmentFactory);
        
        // Create _hashFunction
        paramName = StoreParams.PARAM_HASH_FUNCTION_CLASS;
        paramValue = _properties.getProperty(paramName);
        HashFunction<byte[]> hashFunction = null;
        if(paramValue != null) {
            try {
                hashFunction = (HashFunction<byte[]>)Class.forName(paramValue).newInstance();
            } catch(Exception e) {
                _logger.warn("Invalid HashFunction<byte[]> class: " + paramValue);
            }
        }
        if(hashFunction == null) {
            hashFunction = new FnvHashFunction();
        }
        setHashFunction(hashFunction);
        
        // Create _dataHandler
        paramName = StoreParams.PARAM_DATA_HANDLER_CLASS;
        paramValue = _properties.getProperty(paramName);
        DataHandler dataHandler = null;
        if(paramValue != null) {
            try {
                dataHandler = (DataHandler)Class.forName(paramValue).newInstance();
            } catch(Exception e) {
                _logger.warn("Invalid DataHandler class: " + paramValue);
            }
        }
        if(dataHandler != null) {
            setDataHandler(dataHandler);
        }
    }
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));
        }
    }
219083
protected Properties loadProperties(Resource resource, String filename) throws IOException {
		InputStream is = resource.getInputStream();
		Properties props = new Properties();
		try {
			if (resource.getFilename().endsWith(XML_SUFFIX)) {
				if (logger.isDebugEnabled()) {
					logger.debug("Loading properties [" + resource.getFilename() + "]");
				}
				this.propertiesPersister.loadFromXml(props, is);
			}
			else {
				String encoding = null;
				if (this.fileEncodings != null) {
					encoding = this.fileEncodings.getProperty(filename);
				}
				if (encoding == null) {
					encoding = this.defaultEncoding;
				}
				if (encoding != null) {
					if (logger.isDebugEnabled()) {
						logger.debug("Loading properties [" + resource.getFilename() + "] with encoding '" + encoding + "'");
					}
					this.propertiesPersister.load(props, new InputStreamReader(is, encoding));
				}
				else {
					if (logger.isDebugEnabled()) {
						logger.debug("Loading properties [" + resource.getFilename() + "]");
					}
					this.propertiesPersister.load(props, is);
				}
			}
			return props;
		}
		finally {
			is.close();
		}
	}