
import java.util.HashMap;

import java.util.Enumeration;

/**
 * <<Class summary>>
 *
 * @author Vassilios Karakoidas (bkarak@aueb.gr);
 */
public class SystemProperties {
	private static final SystemProperties defaultInstance;
	private HashMap<Properties,String> configuration;
	
	static {
		defaultInstance = new SystemProperties();
	}
	
	private SystemProperties() {
		configuration = new HashMap<Properties,String>();
		Enumeration keys = System.getProperties().keys();
		
		while(keys.hasMoreElements()) {
			String key = (String)keys.nextElement();
			String value = System.getProperty(key);
			Properties safeKey = Properties.get(key);
			
			System.out.printf("Adding %s, %s\n",key.trim(),value.trim());
			configuration.put(safeKey,value.trim());
		}
	}
	
	public String getProperty(Properties key) {
		return configuration.get(key);
	}
	
	public static SystemProperties getInstance() {
		return defaultInstance;
	}
	
	public static void main(String[] args) {
		System.out.println(getInstance().getProperty(Properties.USER_DIR));
	}
}
