Scala封装获取读取配置文件类
object GetPropertiesUtils {
def getProperties(fileName:String,key:String)={
val prop = new Properties()
val inputStream = GetPropertiesUtils.getClass.getClassLoader.getResourceAsStream(fileName)
prop.load(inputStream)
val value = prop.get(key)
value
}
}
网友评论