package v1.utils.config;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * CLASS for property file actions
 *
 * @author Florian Thiery M.Sc.
 */
public class ConfigProperties {

	private static final Properties prop = new Properties();
	private static final String fileName = "configDevServer.properties";

	/**
	 * load property file
	 *
	 * @param fileName
	 * @return loaded or not
	 * @throws IOException
	 */
	private static boolean loadpropertyFile(String fileName) throws IOException {
		InputStream input = null;
		try {
			ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
			input = classLoader.getResourceAsStream(fileName);
			prop.load(input);
			return true;
		} catch (Exception e) {
			throw new IOException(e.toString());
		} finally {
			if (input != null) {
				input.close();
			}
		}
	}

	/**
	 * get parameter of property file
	 *
	 * @param param
	 * @return param value
	 * @throws IOException
	 */
	public static String getPropertyParam(String param) throws IOException {
		loadpropertyFile(fileName);
		return prop.getProperty(param);
	}

}

@@ -115,91 +115,8 @@
 %0D%0A%0D%0A
-/**%0D%0A * CLASS for property file actions%0D%0A *%0D%0A * @author Florian Thiery M.Sc.%0D%0A */%0D%0A
 publ
@@ -256,17 +256,8 @@
 nfig
-DevServer
 .pro
@@ -273,122 +273,8 @@
 %0D%0A%0D%0A
-%09/**%0D%0A%09 * load property file%0D%0A%09 *%0D%0A%09 * @param fileName%0D%0A%09 * @return loaded or not%0D%0A%09 * @throws IOException%0D%0A%09 */%0D%0A
 %09pri
@@ -708,129 +708,8 @@
 %0D%0A%0D%0A
-%09/**%0D%0A%09 * get parameter of property file%0D%0A%09 *%0D%0A%09 * @param param%0D%0A%09 * @return param value%0D%0A%09 * @throws IOException%0D%0A%09 */%0D%0A
 %09pub

set config.properties in api