final FsPermission absFerms = FsCreateModes.applyUMask( permission == null ? FsPermission.getDirDefault() : permission, getUMask()); new FSLinkResolver<Void>() { @Override
FsPermission permission = (permOpt != null) ? permOpt.getValue() : FILE_DEFAULT_PERM; permission = FsCreateModes.applyUMask(permission, getUMask());
private void createDir(Path path, FsPermission perm) throws IOException { files.mkdir(path, perm, false); if (!perm.equals(files.getUMask().applyUMask(perm))) { files.setPermission(path, perm); } }
private void createDir(Path path, FsPermission perm) throws IOException { files.mkdir(path, perm, false); if (!perm.equals(files.getUMask().applyUMask(perm))) { files.setPermission(path, perm); } }
protected void createDir(Path dirPath, FsPermission perms, boolean createParent, String user) throws IOException { lfs.mkdir(dirPath, perms, createParent); if (!perms.equals(perms.applyUMask(lfs.getUMask()))) { lfs.setPermission(dirPath, perms); } }
private void createDir(Path dirPath, FsPermission perms) throws IOException { lfs.mkdir(dirPath, perms, false); if (!perms.equals(perms.applyUMask(lfs.getUMask()))) { lfs.setPermission(dirPath, perms); } }
private static void createDir(FileContext lfs, Path dirPath, FsPermission perms) throws IOException { lfs.mkdir(dirPath, perms, false); if (!perms.equals(perms.applyUMask(lfs.getUMask()))) { lfs.setPermission(dirPath, perms); } } }
protected void createDir(Path dirPath, FsPermission perms, boolean createParent, String user) throws IOException { lfs.mkdir(dirPath, perms, createParent); if (!perms.equals(perms.applyUMask(lfs.getUMask()))) { lfs.setPermission(dirPath, perms); } }
private static void createDir(FileContext lfs, Path dirPath, FsPermission perms) throws IOException { lfs.mkdir(dirPath, perms, false); if (!perms.equals(perms.applyUMask(lfs.getUMask()))) { lfs.setPermission(dirPath, perms); } }
private void createDir(Path path, FsPermission perm) throws IOException { files.mkdir(path, perm, false); if (!perm.equals(files.getUMask().applyUMask(perm))) { files.setPermission(path, perm); } }
protected void createDir(Path dirPath, FsPermission perms, boolean createParent, String user) throws IOException { lfs.mkdir(dirPath, perms, createParent); if (!perms.equals(perms.applyUMask(lfs.getUMask()))) { lfs.setPermission(dirPath, perms); } }
protected void createDir(Path dirPath, FsPermission perms, boolean createParent, String user) throws IOException { lfs.mkdir(dirPath, perms, createParent); if (!perms.equals(perms.applyUMask(lfs.getUMask()))) { lfs.setPermission(dirPath, perms); } }
private static void createDir(FileContext lfs, Path dirPath, FsPermission perms, boolean createParent) throws IOException { lfs.mkdir(dirPath, perms, createParent); if (!perms.equals(perms.applyUMask(lfs.getUMask()))) { lfs.setPermission(dirPath, perms); } } }
@Test public void testCreatePermission() throws IOException { if (Path.WINDOWS) { System.out.println("Cannot run test for Windows"); return; } String filename = "foo"; Path f = createFile(fc, filename); doFilePermissionCheck(FileContext.DEFAULT_PERM.applyUMask(fc.getUMask()), fc.getFileStatus(f).getPermission()); }
protected void createDir(Path dirPath, FsPermission perms, boolean createParent, String user) throws IOException { lfs.mkdir(dirPath, perms, createParent); if (!perms.equals(perms.applyUMask(lfs.getUMask()))) { lfs.setPermission(dirPath, perms); } }
protected void createDir(Path dirPath, FsPermission perms, boolean createParent, String user) throws IOException { lfs.mkdir(dirPath, perms, createParent); if (!perms.equals(perms.applyUMask(lfs.getUMask()))) { lfs.setPermission(dirPath, perms); } }
@Test public void testCreatePermission() throws IOException { if (Path.WINDOWS) { System.out.println("Cannot run test for Windows"); return; } String filename = "foo"; Path f = fileContextTestHelper.getTestRootPath(fc, filename); fileContextTestHelper.createFile(fc, filename); doFilePermissionCheck(FileContext.FILE_DEFAULT_PERM.applyUMask(fc.getUMask()), fc.getFileStatus(f).getPermission()); }
@Test public void testCreatePermission() throws IOException { if (Path.WINDOWS) { System.out.println("Cannot run test for Windows"); return; } String filename = "foo"; Path f = fileContextTestHelper.getTestRootPath(fc, filename); fileContextTestHelper.createFile(fc, filename); doFilePermissionCheck(FileContext.FILE_DEFAULT_PERM.applyUMask(fc.getUMask()), fc.getFileStatus(f).getPermission()); }
@Test public void testDefaultFilePermission() throws IOException { Path file = fileContextTestHelper.getTestRootPath(fc, "testDefaultFilePermission"); FileContextTestHelper.createFile(fc, file); FsPermission expect = FileContext.FILE_DEFAULT_PERM.applyUMask(fc.getUMask()); Assert.assertEquals(expect, fc.getFileStatus(file) .getPermission()); } }
@Test public void testDefaultFilePermission() throws IOException { Path file = fileContextTestHelper.getTestRootPath(fc, "testDefaultFilePermission"); FileContextTestHelper.createFile(fc, file); FsPermission expect = FileContext.FILE_DEFAULT_PERM.applyUMask(fc.getUMask()); Assert.assertEquals(expect, fc.getFileStatus(file) .getPermission()); } }