【发布时间】:2014-09-08 09:08:51
【问题描述】:
我有类似这样的代码,它工作正常,但如何 但我想用 System.getProperty("user.dir"); 替换绝对路径 但这给了我一个带有反斜杠的字符串我该如何解决它, 或替换它,以便将其转换为 c:/........
public static void main(String[] args) throws Exception{
String strPropertiePath=System.getProperty("user.dir");
System.out.println("strPropertiePath "+strPropertiePath);
String absoluthPath2Propertie = "C:/Users/maurice/Dropbox/a_projectturkey/solution_06_09_2014/Application_Propertie/logging.properties";
File fileLog = new File(absoluthPath2Propertie);
LogManager.getLogManager().readConfiguration(new FileInputStream(absoluthPath2Propertie));
//ConfigSystem.setup();
}
}
【问题讨论】:
标签: java properties filepath