FsPermission permission() { return new PermissionParam(param(PermissionParam.NAME)). getFileFsPermission(); }
/** @return the represented FsPermission. */ public FsPermission getFileFsPermission() { return this.getFsPermission(DEFAULT_FILE_PERMISSION); }
/** @return the represented FsPermission. */ public FsPermission getFsPermission() { final Short v = getValue(); return new FsPermission(v != null? v: DEFAULT_PERMISSION); } }
permission.getDirFsPermission() : FsCreateModes.create(permission.getDirFsPermission(), unmaskedPermission.getDirFsPermission()); final boolean b = cp.mkdirs(fullpath, masked, true); PermissionParam.getDefaultSymLinkFsPermission(), createParent.getValue()); return Response.ok().type(MediaType.APPLICATION_OCTET_STREAM).build(); cp.setPermission(fullpath, permission.getDirFsPermission()); return Response.ok().type(MediaType.APPLICATION_OCTET_STREAM).build();
@Override public void setPermission(final Path p, final FsPermission permission ) throws IOException { statistics.incrementWriteOps(1); final HttpOpParam.Op op = PutOpParam.Op.SETPERMISSION; new FsPathRunner(op, p,new PermissionParam(permission)).run(); }
FsPermission permission() { return new PermissionParam(param(PermissionParam.NAME)).getFsPermission(); }
final boolean b = np.mkdirs(fullpath, permission.getFsPermission(), true); final String js = JsonUtil.toJsonString("boolean", b); return Response.ok(js).type(MediaType.APPLICATION_JSON).build(); PermissionParam.getDefaultFsPermission(), createParent.getValue()); return Response.ok().type(MediaType.APPLICATION_OCTET_STREAM).build(); np.setPermission(fullpath, permission.getFsPermission()); return Response.ok().type(MediaType.APPLICATION_OCTET_STREAM).build();
@Override public void setPermission(final Path p, final FsPermission permission ) throws IOException { statistics.incrementWriteOps(1); final HttpOpParam.Op op = PutOpParam.Op.SETPERMISSION; new FsPathRunner(op, p,new PermissionParam(permission)).run(); }
FsPermission permission() { return new PermissionParam(param(PermissionParam.NAME)).getFsPermission(); }
final boolean b = np.mkdirs(fullpath, permission.getFsPermission(), true); final String js = JsonUtil.toJsonString("boolean", b); return Response.ok(js).type(MediaType.APPLICATION_JSON).build(); PermissionParam.getDefaultFsPermission(), createParent.getValue()); return Response.ok().type(MediaType.APPLICATION_OCTET_STREAM).build(); np.setPermission(fullpath, permission.getFsPermission()); return Response.ok().type(MediaType.APPLICATION_OCTET_STREAM).build();
@Override public void setPermission(final Path p, final FsPermission permission ) throws IOException { statistics.incrementWriteOps(1); storageStatistics.incrementOpCounter(OpType.SET_PERMISSION); final HttpOpParam.Op op = PutOpParam.Op.SETPERMISSION; new FsPathRunner(op, p,new PermissionParam(permission)).run(); }
@Test public void testPermissionParam() { final PermissionParam p = new PermissionParam(PermissionParam.DEFAULT); Assert.assertEquals(new FsPermission((short)0755), p.getFsPermission()); new PermissionParam("0"); new PermissionParam("-1"); Assert.fail(); } catch(IllegalArgumentException e) { new PermissionParam("1777"); new PermissionParam("2000"); Assert.fail(); } catch(IllegalArgumentException e) { new PermissionParam("8"); Assert.fail(); } catch(IllegalArgumentException e) { new PermissionParam("abc"); Assert.fail(); } catch(IllegalArgumentException e) {
/** @return the represented FsPermission. */ public FsPermission getDirFsPermission() { return this.getFsPermission(DEFAULT_DIR_PERMISSION); }
/** @return the represented FsPermission. */ public FsPermission getFsPermission() { final Short v = getValue(); return new FsPermission(v != null? v: DEFAULT_PERMISSION); } }
@Override public boolean mkdirs(Path f, FsPermission permission) throws IOException { statistics.incrementWriteOps(1); final HttpOpParam.Op op = PutOpParam.Op.MKDIRS; return new FsPathBooleanRunner(op, f, new PermissionParam(applyUMask(permission)) ).run(); }
private FsPermission getFsPermission(short defaultPermission){ final Short v = getValue(); return new FsPermission(v != null? v: defaultPermission); }
@Override public boolean mkdirs(Path f, FsPermission permission) throws IOException { statistics.incrementWriteOps(1); final HttpOpParam.Op op = PutOpParam.Op.MKDIRS; return new FsPathBooleanRunner(op, f, new PermissionParam(applyUMask(permission)) ).run(); }
@Override public boolean mkdirs(Path f, FsPermission permission) throws IOException { statistics.incrementWriteOps(1); storageStatistics.incrementOpCounter(OpType.MKDIRS); final HttpOpParam.Op op = PutOpParam.Op.MKDIRS; final FsPermission modes = applyUMask(permission); return new FsPathBooleanRunner(op, f, new PermissionParam(modes.getMasked()), new UnmaskedPermissionParam(modes.getUnmasked()) ).run(); }
@Override public FSDataOutputStream create(final Path f, final FsPermission permission, final boolean overwrite, final int bufferSize, final short replication, final long blockSize, final Progressable progress) throws IOException { statistics.incrementWriteOps(1); final HttpOpParam.Op op = PutOpParam.Op.CREATE; return new FsPathOutputStreamRunner(op, f, bufferSize, new PermissionParam(applyUMask(permission)), new OverwriteParam(overwrite), new BufferSizeParam(bufferSize), new ReplicationParam(replication), new BlockSizeParam(blockSize) ).run(); }
@Override public FSDataOutputStream create(final Path f, final FsPermission permission, final boolean overwrite, final int bufferSize, final short replication, final long blockSize, final Progressable progress) throws IOException { statistics.incrementWriteOps(1); final HttpOpParam.Op op = PutOpParam.Op.CREATE; return new FsPathOutputStreamRunner(op, f, bufferSize, new PermissionParam(applyUMask(permission)), new OverwriteParam(overwrite), new BufferSizeParam(bufferSize), new ReplicationParam(replication), new BlockSizeParam(blockSize) ).run(); }