/** * * @Title: getValue * @Description: TODO * @param key * @return import java.util.Properties; * @return: String */ public static String getValue(String key){ Properties prop = new Properties(); InputStream in = new PropertiesUtil().getClass().getResourceAsStream("/children_task.properties"); try { prop.load(in); } catch (IOException e) { e.printStackTrace(); } return prop.getProperty(key); } public static void main(String[] args) { System.out.println("channel="+getValue("channel")); System.out.println("url="+getValue("url")); }