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(File file)
Convenient call to load a properties file from the provided file
if (file == null)
    return null;
FileReader reader = new FileReader(file);
try {
    return loadProperties(reader);
} finally {
    reader.close();
MaploadProperties(File file)
load Properties
Properties properties = new Properties();
try (InputStream in = new FileInputStream(file)) {
    properties.load(in);
return fromProperties(properties);
PropertiesloadProperties(File file)
load Properties
if (file != null) {
    if (!file.isDirectory()) {
        InputStream inputStream = new FileInputStream(file);
        return loadProperties(inputStream);
    } else {
        return loadPropertyDirectory(file);
return null;
PropertiesloadProperties(File file)
load Properties
Properties props = new Properties();
try {
    final InputStream in = new BufferedInputStream(new FileInputStream(file));
    try {
        props.load(in);
        return props;
    } finally {
        safeClose(in);
...
PropertiesloadProperties(File file)
Loads a file into a Properties object
Properties properties = new Properties();
FileInputStream fis = new FileInputStream(file);
try {
    properties.load(fis);
} finally {
    fis.close();
return properties;
...
PropertiesloadProperties(File file, String charset)
load Properties
InputStream in = null;
try {
    in = new FileInputStream(file);
    return loadProperties(in, charset);
} finally {
    if (in != null) {
        in.close();
voidloadProperties(File fileName)
load Properties
Properties properties = new Properties();
InputStream is = new FileInputStream(fileName);
try {
    properties.load(is);
} finally {
    is.close();
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
...
PropertiesloadProperties(File path)
Loads properties from the specified file.
if (path == null) {
    throw new IllegalArgumentException("path must not be null"); 
try (FileInputStream in = new FileInputStream(path)) {
    Properties properties = new Properties();
    properties.load(in);
    return properties;
PropertiesloadProperties(File propertyFile)
load Properties
Properties properties = new Properties();
if (propertyFile.exists()) {
    InputStream in = null;
    try {
        in = new FileInputStream(propertyFile);
        properties.load(in);
    } catch (IOException e) {
        throw new RuntimeException(e);
...
booleanloadProperties(File propertyFile, Properties properties)
load Properties
if (propertyFile.exists()) {
    FileInputStream fis = null;
    try {
        fis = new FileInputStream(propertyFile);
        properties.load(fis);
        fis.close();
        return true;
    } catch (IOException e) {
...