Newer
Older
irisDatabase / src / com / casic / birmm / util / Configure.java
TAN YUE on 9 Oct 2020 760 bytes 20201008 初始建立
package com.casic.birmm.util;

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

public class Configure {

	private static Properties properties = new Properties();

	static {
		try {
			ClassLoader cl = Configure.class.getClassLoader();
			InputStream is = cl.getResourceAsStream("sys.properties");
			properties.load(is);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static String getProperty(String key) {
		return properties.getProperty(key);
	}
	
	public static String getProperty(String key, String defaultValue) {
		String value = properties.getProperty(key);
		if (null == value) {
			return defaultValue;
		} else {
			return value;
		}
	}

	public static void main(String[] args) {
		
	}

}