Here you can find the source of loadPropertiyFile(String file)
public static Map loadPropertiyFile(String file)
//package com.java2s; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Map; import java.util.Properties; public class Main { public static Map loadPropertiyFile(String file) { File f = new File(file); Properties pro = new Properties(); if (f.exists()) { try { FileInputStream in = new FileInputStream(f); pro.load(in);//from www . jav a2 s. co m } catch (IOException e) { System.out.println("loadPropertyFile() - error: " + e.getMessage()); e.printStackTrace(); } } else { System.out.println("File not found! - " + file); } return pro; } }