/** * 根据关键字获取对应属性 * @param key * @param propertiesFilePath * @return */ public String getValueByKeyOfProperties(String key,String propertiesFilePath){ Properties properties = new Properties(); try { FileInputStream fis = new FileInputStream(propertiesFilePath); properties.load(fis); fis.close(); } catch (FileNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } return null==properties.getProperty(key)? null:properties.getProperty(key); }