Converting Relative Paths to Absolute Paths

前端 未结 9 1269
北荒
北荒 2020-12-05 04:14

I have an absolute path to file A.

I have a relative path to file B from file A\'s directory. This path may and will use \"..\" to go up the directory structure in

9条回答
  •  悲&欢浪女
    2020-12-05 05:15

    Windows path to full Java path.

    String winPath = downloadPath+"\\"+dir_contents[i].getName();
    String absPath = winPath.replace("\\","\\\\");
    

提交回复
热议问题