标签:str inpu fileinput temp NPU java TE ctp put
package com.cvicse.ump.core; import java.io.FileInputStream; import java.util.HashMap; import java.util.Map; import java.util.Properties; /** * Createy by user on 6/6/2018.10:41 */ public class LoadProperty { public static Map<String, String> loadProperty() { try { // System.getProperty("user.dir") 获取项目所在的路径 String filePath = System.getProperty("user.dir") + "/cfg/connect_cfg.properties"; Properties prop = new Properties(); FileInputStream in = new FileInputStream(filePath); prop.load(in); System.out.println(filePath); Map<String, String> params = new HashMap<String, String>(); params.put("port", prop.getProperty("connectPort")); } catch (Exception e) { e.printStackTrace(); } return null; } public static void main(String[] args) { loadProperty(); } }
标签:str inpu fileinput temp NPU java TE ctp put
原文地址:https://www.cnblogs.com/xiaolei2017/p/9204711.html