目前,我使用 "/"+
方法获得绝对路径,我对此感到不舒服。
Paths.get("/" + someFolder, this.backOfficeProperties.getMassivePendingLocation());
我想必须有另一种更优雅的方法来做到这一点。
有什么想法吗?
最佳答案
如果您担心平台相关,则可以使用 File.separator
,它将是 \
或 /
取决于您运行软件的系统。
关于Java路径: Build and absolute path,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54552684/