public class WxUtils {
private static AcessToken token = null;
private static Long acessTokenSaveTime = 0L;
public static final String APP_SECRET;
public static final String APP_ID;
static {
System.out.println("wxutils static area excute");
Properties prop = new Properties();
try {
prop.load(WxUtils.class.getResourceAsStream("/sys.properties"));
} catch (IOException e1) {
e1.printStackTrace();
}
APP_ID = prop.getProperty("app_id");
APP_SECRET = prop.getProperty("app_secret");
WX_TOKEN = prop.getProperty("token");
IS_SAFE_MODE = prop.getProperty("is_safe_mode").equals("true");
ADAPTER_PATH = prop.getProperty("adapterPath");
if (IS_SAFE_MODE) {
AES_KEY = prop.getProperty("encodingAesKey");
} else {
AES_KEY = null;
}
System.out.println(APP_ID);
System.out.println(APP_SECRET);
}
}
java properties的读取
最新推荐文章于 2023-05-25 23:45:24 发布