test/java/io/File/SetAccess.java

Print this page

        

*** 25,34 **** --- 25,35 ---- @bug 4167472 5097703 6216563 6284003 6728842 6464744 @summary Basic test for setWritable/Readable/Executable methods */ import java.io.*; + import java.nio.file.*; import java.nio.file.attribute.*; public class SetAccess { public static void main(String[] args) throws Exception { File d = new File(System.getProperty("test.dir", "."));
*** 176,185 **** if (f.exists() && !f.delete()) throw new Exception("Can't delete test dir: " + f); } private static String permission(File f) throws Exception { ! PosixFileAttributes attrs = Attributes.readPosixFileAttributes(f.toPath()); String type = attrs.isDirectory() ? "d" : " "; return type + PosixFilePermissions.toString(attrs.permissions()); } } --- 177,186 ---- if (f.exists() && !f.delete()) throw new Exception("Can't delete test dir: " + f); } private static String permission(File f) throws Exception { ! PosixFileAttributes attrs = Files.readAttributes(f.toPath(), PosixFileAttributes.class); String type = attrs.isDirectory() ? "d" : " "; return type + PosixFilePermissions.toString(attrs.permissions()); } }