object UMEPort {
def main(args: Array[String]): Unit = {
def getPort(): Unit = {
val properties = new Properties()
//绝对路径
//val path = "E:\\cson\\vmax-cson-app\\rdk\\vmax-ai-cson-webapp\\server\\libcode\\src\\main\\resources\\UMEport.properties"
//使用File获取resources里面资源文件的相对路径
val path = new File(this.getClass().getResource("/UMEport.properties").getPath());
val result = properties.load(new FileInputStream(path))
println(properties.getProperty("port1"))//读取键为poet1的数据的值28001
}
getPort()
}
}