Here you can find the source of loadProperties(String fileName)
public static Properties loadProperties(String fileName)
//package com.java2s; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; public class Main { public static Properties loadProperties(String fileName) { Properties prop = new Properties(); File file = new File(fileName); BufferedInputStream in = null; try {// w w w .ja v a 2s . co m in = new BufferedInputStream(new FileInputStream(file)); prop.load(in); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (in != null) { try { in.close(); } catch (IOException e) { // do nothing } } } return prop; } }