--- old/src/share/sample/nio/file/Chmod.java Wed Jan 26 14:12:30 2011 +++ new/src/share/sample/nio/file/Chmod.java Wed Jan 26 14:12:29 2011 @@ -264,11 +264,10 @@ /** * Changes the permissions of the file using the given Changer. */ - static void chmod(FileRef file, Changer changer) { + static void chmod(Path file, Changer changer) { try { - Set perms = Attributes - .readPosixFileAttributes(file).permissions(); - Attributes.setPosixFilePermissions(file, changer.change(perms)); + Set perms = Files.getPosixFilePermissions(file); + Files.setPosixFilePermissions(file, changer.change(perms)); } catch (IOException x) { System.err.println(x); } @@ -277,7 +276,7 @@ /** * Changes the permission of each file and directory visited */ - static class TreeVisitor implements FileVisitor { + static class TreeVisitor implements FileVisitor { private final Changer changer; TreeVisitor(Changer changer) { @@ -285,19 +284,19 @@ } @Override - public FileVisitResult preVisitDirectory(FileRef dir, BasicFileAttributes attrs) { + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { chmod(dir, changer); return CONTINUE; } @Override - public FileVisitResult visitFile(FileRef file, BasicFileAttributes attrs) { + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { chmod(file, changer); return CONTINUE; } @Override - public FileVisitResult postVisitDirectory(FileRef dir, IOException exc) { + public FileVisitResult postVisitDirectory(Path dir, IOException exc) { if (exc != null) System.err.println("WARNING: " + exc); return CONTINUE; @@ -304,7 +303,7 @@ } @Override - public FileVisitResult visitFileFailed(FileRef file, IOException exc) { + public FileVisitResult visitFileFailed(Path file, IOException exc) { System.err.println("WARNING: " + exc); return CONTINUE; }