Here you can find the source of loadProperties(File f)
public static Properties loadProperties(File f) throws IOException
//package com.java2s; /* The contents of this file are subject to the license and copyright terms * detailed in the license directory at the root of the source tree (also * available online at http://fedora-commons.org/license/). *///from www . j a v a 2 s .co m import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; public class Main { /** * Load properties from the given file. */ public static Properties loadProperties(File f) throws IOException { Properties props = new Properties(); FileInputStream in = new FileInputStream(f); try { props.load(in); return props; } finally { try { in.close(); } catch (IOException e) { } } } }