@Test public void getLocalFileMode() throws IOException { File tmpDir = mTestFolder.newFolder("dir"); File tmpFile777 = mTestFolder.newFile("dir/0777"); tmpFile777.setReadable(true, false ); tmpFile777.setWritable(true, false ); tmpFile777.setExecutable(true, false ); File tmpFile755 = mTestFolder.newFile("dir/0755"); tmpFile755.setReadable(true, false ); tmpFile755.setWritable(false, false ); tmpFile755.setExecutable(true, false ); tmpFile755.setWritable(true, true ); File tmpFile444 = mTestFolder.newFile("dir/0444"); tmpFile444.setReadOnly(); assertEquals((short) 0777, FileUtils.getLocalFileMode(tmpFile777.getPath())); assertEquals((short) 0755, FileUtils.getLocalFileMode(tmpFile755.getPath())); assertEquals((short) 0444, FileUtils.getLocalFileMode(tmpFile444.getPath())); FileUtils.deletePathRecursively(tmpDir.getAbsolutePath()); }
public static short getLocalFileMode(String filePath) throws IOException { Set<PosixFilePermission> permission = Files.readAttributes(Paths.get(filePath), PosixFileAttributes.class).permissions(); return translatePosixPermissionToMode(permission); }
FileUtils { public static short getLocalFileMode(String filePath) throws IOException { Set<PosixFilePermission> permission = Files.readAttributes(Paths.get(filePath), PosixFileAttributes.class).permissions(); return translatePosixPermissionToMode(permission); } }
FileUtils { public static short getLocalFileMode(String filePath) throws IOException { Set<PosixFilePermission> permission = Files.readAttributes(Paths.get(filePath), PosixFileAttributes.class).permissions(); return translatePosixPermissionToMode(permission); } private  FileUtils(); }
FileUtils { public static short getLocalFileMode(String filePath) throws IOException { Set<PosixFilePermission> permission = Files.readAttributes(Paths.get(filePath), PosixFileAttributes.class).permissions(); return translatePosixPermissionToMode(permission); } private  FileUtils(); static void changeLocalFileGroup(String path, String group); static void changeLocalFilePermission(String filePath, String perms); static void changeLocalFileToFullPermission(String filePath); static String getLocalFileOwner(String filePath); static String getLocalFileGroup(String filePath); static short getLocalFileMode(String filePath); static short translatePosixPermissionToMode(Set<PosixFilePermission> permission); static void changeLocalFileUser(String path, String user); static void setLocalDirStickyBit(String dir); static void createBlockPath(String path, String workerDataFolderPermissions); static void move(String srcPath, String dstPath); static void delete(String path); static void deletePathRecursively(String path); static boolean createStorageDirPath(String path, String workerDataFolderPermissions); static void createFile(String filePath); static void createDir(String path); static boolean exists(String path); static boolean isStorageDirAccessible(String path); }
FileUtils { public static short getLocalFileMode(String filePath) throws IOException { Set<PosixFilePermission> permission = Files.readAttributes(Paths.get(filePath), PosixFileAttributes.class).permissions(); return translatePosixPermissionToMode(permission); } private  FileUtils(); static void changeLocalFileGroup(String path, String group); static void changeLocalFilePermission(String filePath, String perms); static void changeLocalFileToFullPermission(String filePath); static String getLocalFileOwner(String filePath); static String getLocalFileGroup(String filePath); static short getLocalFileMode(String filePath); static short translatePosixPermissionToMode(Set<PosixFilePermission> permission); static void changeLocalFileUser(String path, String user); static void setLocalDirStickyBit(String dir); static void createBlockPath(String path, String workerDataFolderPermissions); static void move(String srcPath, String dstPath); static void delete(String path); static void deletePathRecursively(String path); static boolean createStorageDirPath(String path, String workerDataFolderPermissions); static void createFile(String filePath); static void createDir(String path); static boolean exists(String path); static boolean isStorageDirAccessible(String path);  }