创建路径

Path 类用于 programmaticaly 表示文件系统中的路径(因此可以指向文件和目录,甚至指向不存在的路径)

可以使用帮助程序类 Paths 获取路径:

Path p1 = Paths.get("/var/www");
Path p2 = Paths.get(URI.create("file:///home/testuser/File.txt"));
Path p3 = Paths.get("C:\\Users\\DentAr\\Documents\\HHGTDG.odt");
Path p4 = Paths.get("/home", "arthur", "files", "diary.tex");