Get the filePath from Filename using Java

后端 未结 5 915
日久生厌
日久生厌 2021-01-04 05:33

Is there a easy way to get the filePath provided I know the Filename?

5条回答
  •  别那么骄傲
    2021-01-04 06:19

    You can use the Path api:

    Path p = Paths.get(yourFileNameUri);
    Path folder = p.getParent();
    

提交回复
热议问题