Here you can find the source of readFile(File f)
public static Map<String, String> readFile(File f)
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.util.HashMap; import java.util.Map; public class Main { public static Map<String, String> readFile(File f) { Map<String, String> map = new HashMap<>(); try {/*from w w w .j a v a 2 s . c om*/ BufferedReader buffer = new BufferedReader(new FileReader(f)); //List<String> lst = buffer.lines().filter(s -> s.matches("(?!#).*[ ]?=[ ]?.*")).forEach(s -> { String k[] = s.split("="); k[1] = k[1].split("#")[0].trim(); map.put(k[0].trim(), k[1]); }); } catch (FileNotFoundException e) { e.printStackTrace(); } return map; } }