一、resolve方法
Path接口中resolve方法的作用相当于把当前路径当成父目录,而把参数中的路径当成子目录或是其中的文件,进行解析之后得到一个新路径;
Path path1 = Paths.get("folder1", "sub1");
Path path2 = Paths.get("folder2", "sub2");
path1.resolve(path2); //folder1\sub1\folder2\sub2
Path接口中resolve方法的作用相当于把当前路径当成父目录,而把参数中的路径当成子目录或是其中的文件,进行解析之后得到一个新路径;
Path path1 = Paths.get("folder1", "sub1");
Path path2 = Paths.get("folder2", "sub2");
path1.resolve(path2); //folder1\sub1\folder2\sub2