`

原来这样读取属性文件的内容呀

    博客分类:
  • SSH
 
阅读更多

public class SiteUrl {
 public static String readUrl(String key){
  Properties properties = new Properties();
  try {
   properties.load(SiteUrl.class.getClassLoader().getResourceAsStream("siteurl.properties"));
  } catch (IOException e) {
   e.printStackTrace();
  }
  return (String)properties.getProperty(key);
 }
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics