Information about a path can be get using the methods of a Path object:

Path p1 = Paths.get("/var/www"); // p1.toString() returns "/var/www"
Path p1 = Paths.get("/var/www"); // p1.getFileName() returns "www"
Path p3 = Paths.get("C:\\\\Users\\\\DentAr\\\\Documents\\\\HHGTDG.odt"); // p3.getFileName() returns "HHGTDG.odt"
Path p1 = Paths.get("/var/www"); // p1.getNameCount() returns 2
Path p1 = Paths.get("/var/www"); // p1.getName(0) returns "var", p1.getName(1) returns "www"
Path p1 = Paths.get("/var/www"); // p1.getParent().toString() returns "/var"
Path p1 = Paths.get("/var/www"); // p1.getRoot().toString() returns "/"
Path p3 = Paths.get("C:\\\\Users\\\\DentAr\\\\Documents\\\\HHGTDG.odt"); // p3.getRoot().toString() returns "C:\\\\"