Java NIO file path issue

前端 未结 8 2036
臣服心动
臣服心动 2020-12-01 11:36

I used the following code to get the path

Path errorFilePath = FileSystems.getDefault().getPath(errorFile);

When I try to move

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-01 12:29

    Another way to get rid of the leading separator is to create a new file and convert it to a string then:

    new File(Platform.getInstallLocation().getURL().getFile()).toString()
    

提交回复
热议问题