package com.infotech.common.util; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; /** * @ClassName Confkit.java * @Description TODO * * @author D.C * @version V1.0 * @CreateDate 2017年7月5日 下午3:29:05 * */ public class Confkit { private static Properties props = new Properties(); static { try { props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("conf.properties")); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } public static String get(String key) { return props.getProperty(key); } public static void setProps(Properties p){ props = p; } }
学不学,不学就穷死!!!