Here you can find the source of loadProperties(final String file)
public static Properties loadProperties(final String file)
//package com.java2s; //License from project: Apache License import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Properties; public class Main { public static Properties loadProperties(final String file) { final Properties props = new Properties(); FileReader fr = null;//from ww w. jav a 2 s . co m try { fr = new FileReader(file); props.load(fr); return props; } catch (final FileNotFoundException fe) { System.out.println("File not found" + file); return null; } catch (final Exception e) { e.printStackTrace(); return null; } finally { if (fr != null) { try { fr.close(); } catch (final IOException e) { e.printStackTrace(); } } } } }