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) { } }