Java Properties Load from File loadProperties(String configurationPath)

Here you can find the source of loadProperties(String configurationPath)

Description

Load the properties for the application.

License

Apache License

Parameter

Parameter Description
configurationPath The local path of the properties file.

Return

The properties object.

Declaration

public static Properties loadProperties(String configurationPath) throws Exception 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.FileInputStream;

import java.util.Properties;

public class Main {
    /**//  w  ww . java2  s  . c o  m
     * Load the properties for the application.
     * @param configurationPath The local path of the properties file.
     * @return The properties object.
     */
    public static Properties loadProperties(String configurationPath) throws Exception {
        Properties props = new Properties();

        try (FileInputStream inputStream = new FileInputStream(configurationPath)) {
            props.load(inputStream);
        }

        return props;
    }
}

Related

  1. loadProperties(Properties properties, File file)
  2. loadProperties(Properties properties, File propertyFile)
  3. loadProperties(Properties properties, File propertyFile)
  4. loadProperties(String configFilePath)
  5. loadProperties(String configurationFileProperty, String configurationFileDefault)
  6. loadProperties(String file)
  7. loadProperties(String filename)
  8. loadProperties(String filename)
  9. loadProperties(String fileName)