标签:静态块 source exception catch private ops cep accesskey 执行
public class FileConfig { private static String ACCESS_KEY;private static String END_POINT;static { Properties props = new Properties(); try { props.load(FileConfig.class.getResourceAsStream("/resource.properties")); ACCESS_KEY = props.getProperty("accessKey"); END_POINT = props.getProperty("endPoint"); } catch (Exception e) { System.out.println("can not find resource.properties file"); } } public static String getAccessKey() { return ACCESS_KEY; } public static String getEndPoint() { return END_POINT; } }
标签:静态块 source exception catch private ops cep accesskey 执行
原文地址:http://www.cnblogs.com/dali-lyc/p/7297422.html