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

PropertiesloadProperties(String fileName, boolean systemOverride)
load Properties
Properties kernelProps = new Properties();
InputStream is = null;
boolean propsLoaded = false;
if (fileName != null && fileName.length() > 0) {
    try {
        is = new BufferedInputStream(new FileInputStream(fileName));
        if (fileName.endsWith(".xml"))
            kernelProps.loadFromXML(is);
...
voidloadProperties(String fileName, Properties properties)
load Properties
try {
    FileInputStream fis = new FileInputStream(makeFullPathname(fileName));
    BufferedInputStream bis = new BufferedInputStream(fis);
    properties.load(bis);
    bis.close();
    fis.close();
} catch (FileNotFoundException e) {
} catch (IOException e) {
...
PropertiesloadProperties(String filePath)
load Properties
File file = new File(filePath);
if (!file.exists()) {
    try {
        file.createNewFile();
    } catch (IOException e) {
        throw new IllegalStateException(e);
return loadProperties(file);
PropertiesloadProperties(String filePath)
load Properties
InputStream inputStream = ClassLoader.getSystemResourceAsStream(filePath);
Properties properties = new Properties();
properties.load(inputStream);
inputStream.close();
return properties;
PropertiesloadProperties(String path)
load Properties
Properties properties = new Properties();
try {
    properties.load(new FileInputStream(path));
    return properties;
} catch (IOException e) {
    throw new RuntimeException("Cannot open " + path);
PropertiesloadProperties(String path, Class caller)
load Properties
InputStream is = getResourceAsStream(path, caller);
if (is == null) {
    return null;
Properties p = new Properties();
try {
    p.load(is);
} catch (IOException ioe) {
...
PropertiesloadProperties(String path, Properties defaults)
load Properties
return loadProperties(new File(path), defaults);
PropertiesloadProperties(String propertiesFile)
load Properties
if (propertiesFile != null) {
    File file = new File(propertiesFile);
    if (file.exists()) {
        Properties properties = new Properties();
        FileInputStream inputStream = new FileInputStream(propertiesFile);
        try {
            properties.load(inputStream);
        } finally {
...
PropertiesloadProperties(String propertiesFile)
load Properties
Properties props = new Properties();
InputStream in = new FileInputStream(propertiesFile);
props.load(in);
in.close();
return props;
voidloadProperties(String propertyFile)
load Properties
FileInputStream input;
input = new FileInputStream(propertyFile);
properties.load(input);