- 拼接
//定义基本目录 Path base = Paths.get("E:/cn/icer/webservice/client"); //resolve Business.java file Path path1 = base.resolve("Business.java"); System.out.println(path1); //resolve Server.java file Path path2 = base.resolve("Server.java"); System.out.println(path2);
- 置换
//定义固定路径 Path base = Paths.get("E:/cn/icer/webservice/client/Business.java"); //resolve sibling Server.java file Path path = base.resolveSibling("Server.java"); System.out.println(path);
合并两个路径
最新推荐文章于 2024-02-19 13:54:20 发布