Here you can find the source of loadConfiguration(String file)
public static void loadConfiguration(String file) throws IOException
//package com.java2s; /*/*w w w .j a v a 2 s .c o m*/ * Copyright 2005--2008 Helsinki Institute for Information Technology * * This file is a part of Fuego middleware. Fuego middleware is free * software; you can redistribute it and/or modify it under the terms * of the MIT license, included as the file MIT-LICENSE in the Fuego * middleware source distribution. If you did not receive the MIT * license with the distribution, write to the Fuego Core project at * fuego-core-users@googlegroups.com. */ import java.io.FileInputStream; import java.io.IOException; import java.util.Iterator; import java.util.Properties; public class Main { /** Load a Java properties file into the system properties. */ public static void loadConfiguration(String file) throws IOException { Properties p = new Properties(); FileInputStream in = new FileInputStream(file); p.load(in); in.close(); for (Iterator i = p.keySet().iterator(); i.hasNext();) { String key = (String) i.next(); System.setProperty(key, p.getProperty(key)); } } }