@Override public Void doCall(final Path p) throws IOException, UnresolvedLinkException { dfs.setOwner(getPathName(p), username, groupname); return null; }
@Override public Void doCall(final Path p) throws IOException, UnresolvedLinkException { dfs.setOwner(getPathName(p), username, groupname); return null; }
@Override public void setOwner(Path f, String username, String groupname) throws IOException, UnresolvedLinkException { dfs.setOwner(getUriPath(f), username, groupname); }
/** {@inheritDoc }*/ public void setOwner(Path p, String username, String groupname ) throws IOException { if (username == null && groupname == null) { throw new IOException("username == null && groupname == null"); } dfs.setOwner(getPathName(p), username, groupname); }
@Override public void setOwner(Path f, String username, String groupname) throws IOException, UnresolvedLinkException { dfs.setOwner(getUriPath(f), username, groupname); }
/** {@inheritDoc }*/ public void setOwner(Path p, String username, String groupname ) throws IOException { if (username == null && groupname == null) { throw new IOException("username == null && groupname == null"); } dfs.setOwner(getPathName(p), username, groupname); }
@Override public Void doCall(final Path p) throws IOException { dfs.setOwner(getPathName(p), username, groupname); return null; }
@Override public void setOwner(Path f, String username, String groupname) throws IOException, UnresolvedLinkException { dfs.setOwner(getUriPath(f), username, groupname); }
private void setattrInternal(DFSClient dfsClient, String fileIdPath, SetAttr3 newAttr, boolean setMode) throws IOException { EnumSet<SetAttrField> updateFields = newAttr.getUpdateFields(); if (setMode && updateFields.contains(SetAttrField.MODE)) { LOG.debug("set new mode: {}", newAttr.getMode()); dfsClient.setPermission(fileIdPath, new FsPermission((short) (newAttr.getMode()))); } if (updateFields.contains(SetAttrField.UID) || updateFields.contains(SetAttrField.GID)) { String uname = updateFields.contains(SetAttrField.UID) ? iug.getUserName( newAttr.getUid(), IdMappingConstant.UNKNOWN_USER) : null; String gname = updateFields.contains(SetAttrField.GID) ? iug .getGroupName(newAttr.getGid(), IdMappingConstant.UNKNOWN_GROUP) : null; dfsClient.setOwner(fileIdPath, uname, gname); } long atime = updateFields.contains(SetAttrField.ATIME) ? newAttr.getAtime() .getMilliSeconds() : -1; long mtime = updateFields.contains(SetAttrField.MTIME) ? newAttr.getMtime() .getMilliSeconds() : -1; if (atime != -1 || mtime != -1) { LOG.debug("set atime: {} mtime: {}", atime, mtime); dfsClient.setTimes(fileIdPath, mtime, atime); } }
client.setOwner("/dir", "username", "groupname"); client.createSymlink("/dir", "/dir2", false); // SymlinkOp -> CreateEvent client.setXAttr("/file5", "user.field", "value".getBytes(), EnumSet.of(