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

Propertiesload(boolean loadAsResourceBundle, String name, ClassLoader loader)
load
if (name == null) {
    throw new IllegalArgumentException("null input: name");
if (name.startsWith("/")) {
    name = name.substring(1);
Properties result = null;
InputStream in = null;
...
voidload(Class type, String resource, Properties map)
load
load(type, resource, map, true);
Propertiesload(Class cls)
Load a Properties object for a specific class.
Properties properties;
try (InputStream stream = cls.getResourceAsStream(cls.getSimpleName() + ".properties")) {
    if (stream == null) {
        throw new FileNotFoundException("Resource not found for class: " + cls.getName());
    properties = new Properties();
    properties.load(stream);
return properties;
Propertiesload(File f)
load
Properties p = new Properties();
load(p, f);
return p;
Propertiesload(File file)
Loads Properties from a given File .
Properties properties = new Properties();
if (file.isFile()) {
    FileReader fr = new FileReader(file);
    try {
        properties.load(fr);
    } catch (IOException ex) {
        fr.close();
        throw ex;
...
Propertiesload(File file)
load
return load(file, null);
Mapload(File file)
Loads a Map from a File assuming strings as keys and values.
FileInputStream stream = null;
try {
    stream = new FileInputStream(file);
    return load(stream);
} finally {
    closeIfNotNull(stream);
Propertiesload(File file)
Loads the specified properties file into memory
Properties props = new Properties();
props.load(new FileReader(file));
return props;
Stringload(File file)
Tries to load the file and return its content.
StringBuffer result;
BufferedReader reader;
String line;
String newLine;
result = new StringBuffer();
newLine = System.getProperty("line.separator");
reader = null;
try {
...
voidload(File file, Properties data)
Loads a properties file from file.
if (null != file && file.exists()) {
    FileReader fr = null;
    try {
        fr = new FileReader(file);
        data.load(fr);
    } finally {
        if (null != fr) {
            fr.close();
...