public class PropertiesUtil { public static String get(String filePath, String key) { String val = null; Properties prop = new Properties(); InputStream in = null; in = PropertiesUtil.class.getClassLoader().getResourceAsStream(filePath); try { prop.load(in); val = (String) prop.get(key); } catch (IOException e) { e.printStackTrace(); } try { in.close(); } catch (IOException e) { e.printStackTrace(); } return val; } }
时间: 2024-12-21 13:13:16