Here you can find the source of loadProperties(String configFilePath)
Parameter | Description |
---|---|
configFilePath | the file path of the configuration file |
private static Properties loadProperties(String configFilePath)
//package com.java2s; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Properties; public class Main { /**// w w w.jav a2s .c o m * Load the Properties object from the configuration object. * * @param configFilePath the file path of the configuration file * * @return the properties loaded */ private static Properties loadProperties(String configFilePath) { InputStream in = null; try { Properties prop = new Properties(); in = new FileInputStream(configFilePath); prop.load(in); return prop; } catch (IOException e) { // simply return null, it will never happen return null; } finally { if (in != null) { try { in.close(); } catch (IOException e) { // ignore the exception } } } } }