Here you can find the source of loadProperties(String filePath)
protected static Properties loadProperties(String filePath)
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; public class Main { protected static Properties loadProperties(String filePath) { File file = new File(filePath); if (!file.exists()) { try { file.createNewFile();/*from w w w. ja v a2 s.c om*/ } catch (IOException e) { throw new IllegalStateException(e); } } return loadProperties(file); } /** * Do load properties. * * @param file the file * @return the properties */ public static Properties loadProperties(File file) { Properties props = new Properties(); FileInputStream fis = null; try { fis = new FileInputStream(file); props.load(fis); } catch (Exception e) { throw new IllegalStateException(e); } finally { try { if (fis != null) { fis.close(); } } catch (IOException e) { throw new IllegalStateException(e); } } return props; } }