Here you can find the source of loadPropertiesFile(String filePath)
public static Properties loadPropertiesFile(String filePath)
//package com.java2s; /********************************************************************* * ?????????????????/*from w w w .j a va2 s .c o m*/ * * ? Apache License, Version 2.0 ?????????????????? * * http://www.apache.org/licenses/LICENSE-2.0 * ********************************************************************/ import java.io.FileInputStream; import java.io.InputStream; import java.util.Properties; public class Main { public static Properties loadPropertiesFile(String filePath) { Properties properties = new Properties(); InputStream is = null; try { try { is = new FileInputStream(filePath); properties.load(is); } finally { if (is != null) { is.close(); is = null; } } } catch (Exception e) { properties = null; } return properties; } public static Properties loadPropertiesFile(InputStream is) { Properties properties = new Properties(); try { try { properties.load(is); } finally { if (is != null) { is.close(); is = null; } } } catch (Exception e) { properties = null; } return properties; } }