package com.bluesky.visualprogramming.vm;

import java.io.FileInputStream;
import java.util.Properties;

public class AppProperties {
	static private AppProperties instance;

	public static AppProperties getInstance() {
		if (instance == null) {
			instance = new AppProperties();
		}

		return instance;
	}

	Properties appProperties;
	Properties remoteSecurityConfig;

	public AppProperties() {
		appProperties = new Properties();
		try {
			appProperties.load(AppProperties.class
					.getResourceAsStream("/app.properties"));

			String remoteSecurityFile = appProperties
					.getProperty("remote.security.file");
			remoteSecurityConfig = new Properties();
			remoteSecurityConfig.load(new FileInputStream(remoteSecurityFile));

		} catch (Exception e) {

			e.printStackTrace();
		}

	}

	public Properties getRemoteSecurityConfig() {
		return remoteSecurityConfig;
	}

	public String getProperty(String key) {
		return appProperties.getProperty(key);
	}
}

@@ -102,36 +102,134 @@
 s;%0A%0A
-public class AppProperties %7B
+import org.apache.log4j.Logger;%0A%0Apublic class AppProperties %7B%0A%09static Logger logger = Logger.getLogger(AppProperties.class);%0A%09
 %0A%09st
@@ -856,32 +856,55 @@
 ) %7B%0A
-%0A
 %09%09%09
-e.printStackTrace();
+logger.warn(%22app.properties not found.%22);%09%09%09
 %0A%09%09%7D

add warning for missing app-properties file