确定两条路径是否等效
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path;//时代Java - nowjava.com 提供 import java.nio.file.Paths; public class Main { public static void main(String[] args) { Path path1 = null; Path path2 = null; Path path3 = null; path1 = Paths.get("/home/docs/users.txt");/**from nowjava - 时 代 Java**/ path2 = Paths.get("/home/docs/users.txt"); path3 = Paths.get("/home/music/Future Setting A.mp3"); testEquals(path1, path2); testEquals(path1, path3); testCompareTo(path1, path2); testCompareTo(path1, path3); testSameFile(path1, path2); testSameFile(path1, path3); } private static void testEquals(Path path1, Path path2) { if (path1.equals(path2)) { System.out.printf("%s and %s are equal\n", path1, path2); } else { System.out.printf("%s and %s are NOT equal\n", path1, path2); } } private static void testCompareTo(Path path1, Path path2) { if (path1.compareTo(path2) == 0) { System.out.printf("%s and %s are identical\n", path1, path2); } else { System.out.printf("%s and %s are NOT identical\n", path1, path2); } } private static void testSameFile(Path path1, Path path2) { try { if (Files.i