windows和linux文件路径问题
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
免费下载资源
·
1、
windows平台:用\或\\
linux平台:用/
2、
Java代码中路径分隔符用:File.separator
3、
windows平台也兼容/,也可以统一替换成/
filePath = filePath.replace("\\", "/");
4、路径错误会报错,No Such file or diretory异常
java.io.FileNotFoundException: /home/tomcat/apache-tomcat-7.0.68_HXConsloe/webapps/HXConsole/JCB\\JCB_MerchantDataFile_20170905100340.txt (No such file or directory)
windows平台:用\或\\
linux平台:用/
2、
Java代码中路径分隔符用:File.separator
3、
windows平台也兼容/,也可以统一替换成/
filePath = filePath.replace("\\", "/");
4、路径错误会报错,No Such file or diretory异常
java.io.FileNotFoundException: /home/tomcat/apache-tomcat-7.0.68_HXConsloe/webapps/HXConsole/JCB\\JCB_MerchantDataFile_20170905100340.txt (No such file or directory)
GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
已为社区贡献8条内容
所有评论(0)