Java Utililty Methods Properties Load from File

List of utility methods to do Properties Load from File

Description

The list of methods to do Properties Load from File are organized into topic(s).

Method

PropertiesloadPropertiesFromFile(String fullFileName)
Load all properties from a file
Properties props = new Properties();
loadPropertiesFromFile(props, fullFileName);
return props;
PropertiesloadPropertiesFromFile(String pathname)
load Properties From File
Properties properties = new Properties();
if (pathname == null || pathname.length() == 0)
    return properties;
FileInputStream in = null;
in = new FileInputStream(pathname);
if (in != null) {
    properties.load(in);
    in.close();
...
PropertiesloadPropertiesFromPath(String propsFilePath)
load Properties From Path
InputStream is = null;
try {
    is = new BufferedInputStream(new FileInputStream(propsFilePath));
    Properties props = new Properties();
    props.load(is);
    return props;
} finally {
    close(is);
...
PropertiesloadPropertiesInClassPath(String propertiesFileName)
Read properties by searching the properties file in the classpath
Properties props = new Properties();
try {
    InputStream input = ClassLoader.getSystemResourceAsStream((propertiesFileName));
    props.load(input);
} catch (Exception e) {
    return null;
return props;
...
Map>loadProvidersConfiguration(Class base, String confPropertiesName)
Build the provider map for the specified base class.
HashMap<String, Class<? extends E>> providers;
providers = new HashMap<String, Class<? extends E>>();
InputStream in;
in = base.getResourceAsStream(confPropertiesName);
if (in != null) {
    providers.putAll(readProvidersConfiguration(base, in, "built-in"));
} else
    System.err.format("Built-in configuration not found for %s\n", base.getName());
...
StringloadPythonScript(String pythonScriptName)
load Python Script
FileReader fis = new FileReader(pythonScriptName);
BufferedReader reader = new BufferedReader(fis);
String script = "";
String record = null;
while ((record = reader.readLine()) != null) {
    script = script + System.getProperty("line.separator") + record;
return script;
...
StringloadReader(Reader stream)
load Reader
BufferedReader r = null;
StringBuilder text = new StringBuilder();
try {
    r = new BufferedReader(stream);
    String line = null;
    while ((line = r.readLine()) != null) {
        text.append(line);
        text.append(System.getProperty("line.separator"));
...
PropertiesloadRecursively(String propertiesFilename)
Load the specified properties file and recursively merge all included properties files.
Properties properties = new Properties();
File propertiesFile = new File(propertiesFilename);
FileInputStream fis = new FileInputStream(propertiesFile);
properties.load(fis);
fis.close();
String secondPropertiesFilename = properties.getProperty(PROPERTY_INCLUDE_ABSOLUTE);
if (secondPropertiesFilename != null) {
    properties.remove(PROPERTY_INCLUDE_ABSOLUTE);
...
voidloadRQGProperties()
load RQG Properties
isRQGEnabled = true;
String propertPath = getRQGConfig();
rqg_environment = new Properties();
InputStream stream = null;
if (propertPath == null) {
    propertPath = "rqg_config.properties";
if (propertPath != null) {
...
StringloadSetting(InputStream in, String key)
load Setting
Properties props;
props = new Properties();
props.load(in);
return props.getProperty(key);