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

voidload(Properties properties, String fileName)
Load into the given properties the file from the given fileName.
try {
    properties.load(new FileInputStream(fileName));
} catch (IOException ignored) {
    throw new RuntimeException("Could not load " + fileName);
voidload(Properties props, Collection filters, File basedir)
load
for (String filter : filters) {
    File propFile = new File(filter);
    if (!propFile.isAbsolute()) {
        propFile = new File(basedir, filter).getAbsoluteFile();
    FileInputStream is = new FileInputStream(propFile);
    try {
        props.load(is);
...
voidload(Properties props, File f)
Load.
InputStream is = null;
try {
    is = new FileInputStream(f);
    props.load(is);
} finally {
    if (is != null) {
        is.close();
voidload(Properties props, File file)
load
try (InputStream reader = new FileInputStream(file)) {
    props.load(reader);
    reader.close();
voidload(Properties props, String filename)
load
FileInputStream inp = null;
try {
    inp = new FileInputStream(filename);
    props.load(inp);
} catch (java.io.IOException e) {
    throw new RuntimeException(e);
} finally {
    try {
...
Propertiesload(String file)
Loads properties by given file
return load(new File(file));
Propertiesload(String file)
load
Properties properties = new Properties();
FileInputStream in = new FileInputStream(file);
properties.load(in);
in.close();
return properties;
voidload(String fileName)
load
InputStream stream = getInputStream(fileName);
try {
    if (stream == null) {
        throw new IllegalArgumentException("Unable to load: " + fileName);
    } else {
        PROPERTIES.load(stream);
        trimValues();
} catch (IOException e) {
    throw new IllegalArgumentException("Unable to load: " + fileName, e);
} finally {
    if (stream != null) {
        try {
            stream.close();
        } catch (IOException e) {
            throw new IllegalStateException("Unable to close properties file", e);
Mapload(String filename)
load
FileInputStream fileInputStream = new FileInputStream(new File(filename));
try {
    return load(fileInputStream);
} finally {
    fileInputStream.close();
Propertiesload(String fileName)
load
InputStream is = null;
try {
    Properties props = new Properties();
    is = new FileInputStream(fileName);
    props.load(is);
    return props;
} finally {
    if (is != null) {
...