com.jcraft.jsch.ChannelSftp.chown()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(309)

本文整理了Java中com.jcraft.jsch.ChannelSftp.chown()方法的一些代码示例,展示了ChannelSftp.chown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ChannelSftp.chown()方法的具体详情如下:
包路径:com.jcraft.jsch.ChannelSftp
类名称:ChannelSftp
方法名:chown

ChannelSftp.chown介绍

[英]Changes the owning user of one or several remote files.
[中]更改一个或多个远程文件的所有者用户。

代码示例

代码示例来源:origin: apache/nifi

if (owner != null && !owner.trim().isEmpty()) {
  try {
    sftp.chown(Integer.parseInt(owner), tempPath);
  } catch (final Exception e) {
    logger.error("Failed to set owner on {} to {} due to {}", new Object[] {tempPath, owner, e});

代码示例来源:origin: com.github.robtimus/sftp-fs

void chown(String path, int uid) throws IOException {
  try {
    channel.chown(uid, path);
  } catch (SftpException e) {
    throw exceptionFactory.createSetOwnerException(path, e);
  }
}

代码示例来源:origin: fizzed/blaze

@Override
public void chown(Path path, int uid) {
  try {
    this.channel.chown(uid, PathHelper.toString(path));
  } catch (SftpException e) {
    throw convertSftpException(e);
  }
}

代码示例来源:origin: org.kuali.common/kuali-util

protected void setAttributes(RemoteFile file) throws SftpException {
  String path = file.getAbsolutePath();
  if (file.getPermissions().isPresent()) {
    sftp.chmod(file.getPermissions().get(), path);
  }
  if (file.getGroupId().isPresent()) {
    sftp.chgrp(file.getGroupId().get(), path);
  }
  if (file.getUserId().isPresent()) {
    sftp.chown(file.getUserId().get(), path);
  }
}

代码示例来源:origin: org.kuali.common/kuali-util

protected void setAttributes(RemoteFile file) throws SftpException {
  String path = file.getAbsolutePath();
  if (file.getPermissions().isPresent()) {
    sftp.chmod(file.getPermissions().get(), path);
  }
  if (file.getGroupId().isPresent()) {
    sftp.chgrp(file.getGroupId().get(), path);
  }
  if (file.getUserId().isPresent()) {
    sftp.chown(file.getUserId().get(), path);
  }
}

代码示例来源:origin: org.apache.nifi/nifi-standard-processors

if (owner != null && !owner.trim().isEmpty()) {
  try {
    sftp.chown(Integer.parseInt(owner), tempPath);
  } catch (final Exception e) {
    logger.error("Failed to set owner on {} to {} due to {}", new Object[] {tempPath, owner, e});

代码示例来源:origin: org.kuali.common/kuali-util

protected void setAttributes(RemoteFile file) throws SftpException {
  String path = file.getAbsolutePath();
  if (file.getPermissions() != null) {
    sftp.chmod(file.getPermissions(), path);
  }
  if (file.getGroupId() != null) {
    sftp.chgrp(file.getGroupId(), path);
  }
  if (file.getUserId() != null) {
    sftp.chown(file.getUserId(), path);
  }
}

相关文章

微信公众号

最新文章

更多

ChannelSftp类方法