Here you can find the source of loadPropertiesFromFile(String configFile)
private static InputStream loadPropertiesFromFile(String configFile) throws FileNotFoundException, IOException
//package com.java2s; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Properties; public class Main { private static final String DEFAULT_SERVER = "127.0.0.1"; private static final String DEFAULT_BASE = "RASBASE"; private static final String DEFAULT_PORT = "7001"; private static final String DEFAULT_USER = "rasguest"; private static final String DEFAULT_PASSWD = "rasguest"; private static final String DEFAULT_ADMIN_USER = "rasadmin"; private static final String DEFAULT_ADMIN_PASSWD = "rasadmin"; private static String server; private static String database; private static String port; public static String username; public static String password; public static String adminUsername; public static String adminPassword; private static InputStream loadPropertiesFromFile(String configFile) throws FileNotFoundException, IOException { final InputStream input = new FileInputStream(configFile); final Properties prop = new Properties(); prop.load(input);//from w ww . ja va2s .com server = prop.getProperty("ras.server", DEFAULT_SERVER); database = prop.getProperty("ras.database", DEFAULT_BASE); port = prop.getProperty("ras.port", DEFAULT_PORT); username = prop.getProperty("ras.username", DEFAULT_USER); password = prop.getProperty("ras.password", DEFAULT_PASSWD); adminUsername = prop.getProperty("ras.admin.username", DEFAULT_ADMIN_USER); adminPassword = prop.getProperty("ras.admin.password", DEFAULT_ADMIN_PASSWD); return input; } }