Here you can find the source of loadPropertiesFile(String path)
public static Properties loadPropertiesFile(String path)
//package com.java2s; /***************************************************************************** * Copyright (c) 2015 Chris J Daly (github user cjdaly) * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from w w w . j av a 2s . co m*/ * cjdaly - initial API and implementation ****************************************************************************/ import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Properties; public class Main { public static Properties loadPropertiesFile(String path) { Properties properties = new Properties(); try (BufferedReader reader = new BufferedReader( new FileReader(path))) { properties.load(reader); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } return properties; } }